Area for optimization #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Loop For-of, For inverse
Bench: https://jsperf.com/cache-length-no-cache https://jsperf.com/for-loop-research https://www.incredible-web.com/blog/performance-of-for-loops-with-javascript/
Done
Justify by showing in isolated case is enough.
Reduce property lookup of an object
Reduce GC
https://stackoverflow.com/questions/18364175/best-practices-for-reducing-garbage-collector-activity-in-javascript#18411275
Don't declare stuff often.
deletedoesn't help.https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete
Becnhmarks on clear array: http://jsben.ch/hyj65
__ Can't do much from now__
Multi-core
While JS support multi-thread, but not multi-core processing. HTML5 Web Workers allow multiple isolated processes to be run concurrently, each process have to communicate with each other via JSON strings.
Serializing and parsing objects to JSON is slow, and means multiple copies of the same data exist, probably way too much memory usage and overhead.
However: Web Workers could be used to do computation without blocking main thread.
Can be in future work
asm.js, amost no GC, may be faster for Ahead-of-time compilation
WebAssembly, should have speed up