http://polar.me/blog/2013/05/anaging-memory-in-javascript-is-hard
Use the Timeline view in Chrome Developer Tools to debug memory leaks.
YouTube Video – mobile JS apps optimizations
- use advanced image compression like WebP or tools like ImageOptim
- use gzip, spdy, etc. on server side
- batch network calls to avoid mobile latency when radio turns off; also helps preserve battery
- reduce CSS render weight
- batch DOM manipulation
- use static memory usage patterns
- preallocate objects, etc.
ECMA6 introduced an optimization for tail-call recursion where the last call in a function is purely a recursive call with no other operations. This optimization makes it possible for recursion to be performant by not growing the size of the call stack.
// Tail recursive
function recursive(a, b) {
a = a + b;
return recursive(a, b);
}
// Not tail recursive since 'a' must be kept in the call stack
function recursive(a) {
return a + recursive(a, b);
}
Avoid delete https://groups.google.com/forum/#!msg/v8-users/zE4cOHBkAnY/HCWLAfmmChoJ