borc
borc copied to clipboard
Write up Performance Guide for JS Best Practices
- https://github.com/mraleph/irhydra
node --profandnode --prof-process- Chrome JavaScript profile
- asm.js http://asmjs.org/
- benchmark.js
- measure, measure, measure
- hot code paths
- the fastest code is the one that doesn't run
- early exits
- reuse variables to avoid memory allocations
- Types are important
- arrays
- fixed sized arrays are better than growing & shrinking
- all elements in an array should be of the same type (ideal 32 bit ints)
- initialise variables with the correct type
- avoid using objects
- don't resize buffers
- arrays
@dignifiedquire 🙏🏽