• Independent project development consulting • More than 8 years in professional software development • Latest 6 years Node.js my main and beloved technology
Set NODE_ENV = production 3. Avoid The Heavy Synchronous Code 4. Speed Up JSON Serialization 5. Write The Asynchronous Code Correctly 6. Use The Streams Correctly 7. Try To Optimize V8 GC 8. Move CPU Bound Tasks Out Of The Node.js Code 9. Try To Use C++ Extensions 10. Use Tools To Locate Performance Issues
of objects for parsing / iteration / transformation (ie queries without limits and projections); ▪ Not using DB features (ie GROUP BY, aggregations) where it can be effective. AVOID THE SYNCHRONOUS CODE
web services (ie fs.readFileSync, fs.writeFileSync, child_process.execSync); ▪ Using recursive sync functions; ▪ Wrap heavy sync functions to async/await. AVOID THE SYNCHRONOUS CODE
▪ The implementation is header-only C++ 17 (7K LOC), cross-platform and compiles down to a tiny binary; ▪ µWebSockets.js is the Google V8 bindings to µWebSockets. C++ EXTENSIONS
of simple Doctor examples (slow event loop, slow GC, sync IO etc); ▪ A set of simple Bubbleprof examples; ▪ A MongoDB-based Bubbleprof demo/example; ▪ A Flame demo/example. https://github.com/nearform/node-clinic#examples-and-demos
ever run Express in production without NODE_ENV = production 3. Add limits and pagination to API 4. Review project and use Promise.all where it is possible 5. Use streams for working with large data 6. Try to optimize V8 GC by flags 7. Try to use C++ extensions in critical parts of the application 8. Use load and diagnostic tools for locating performance issues CONCLUSIONS