Upgrade to Pro — share decks privately, control downloads, hide ads and more …

10 things I learned making the fastest js server runtime in the world

10 things I learned making the fastest js server runtime in the world

This presentation is about server performance, which means that no time in the world would be enough to cover it all. Hopefully, I can share with you the top #10 things I've learned while putting JavaScript on the top of the server side benchmarks. You will learn about runtimes and engines, how some are more capable than others, and sometimes the obvious choice is not always the right one... This talk is about thinking outside of the box, being creative and don't take anything for granted. We will debunk myths about native code vs script or RAM usage, it's going to be fast! I promise!

Paulo Lopes

April 03, 2019
Tweet

More Decks by Paulo Lopes

Other Decks in Programming

Transcript

  1. server noun serv· er | \ ˈsər-vər\ a computer in

    a network that is used to provide services (such as access to files or shared peripherals or the routing of e-mail) to other computers in the network @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  2. Site Reliability Engineering is a discipline that incorporates aspects of

    software engineering and applies them to infrastructure and operations problems. The main goals are to create ultra-scalable and highly reliable software systems https://landing.google.com/sre/books/ @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  3. Site Reliability Engineering metrics Rate —  Request rate, in requests/sec Errors 

    Latency  Saturation Utilization @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  4. Site Reliability Engineering metrics Rate —  Request rate, in requests/sec Errors —

     Error rate, in errors/sec Latency  Saturation Utilization @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  5. Site Reliability Engineering metrics Rate —  Request rate, in requests/sec Errors —

     Error rate, in errors/sec Latency —  Response time, including queue/wait time Saturation Utilization @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  6. Server Application long running process deployed on cloud or bare

    metal attached to a fast network "enough" CPU/Memory @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  7. V8 JavaScript engine Speed up real-world performance for modern JavaScript,

    and enable developers to build a faster future web. @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  8. TECHEMPOWER TECHEMPOWER FRAMEWORK BENCHMARKS FRAMEWORK BENCHMARKS COMMITS: COMMITS: CONTRIBUTORS: CONTRIBUTORS:

    https://github.com/TechEmpower/FrameworkBenchmarks/ @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  9. TECHEMPOWER TECHEMPOWER FRAMEWORK BENCHMARKS FRAMEWORK BENCHMARKS COMMITS: COMMITS: 10715 10715

    CONTRIBUTORS: CONTRIBUTORS: https://github.com/TechEmpower/FrameworkBenchmarks/ @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  10. TECHEMPOWER TECHEMPOWER FRAMEWORK BENCHMARKS FRAMEWORK BENCHMARKS COMMITS: COMMITS: 10715 10715

    CONTRIBUTORS: CONTRIBUTORS: 504 504 https://github.com/TechEmpower/FrameworkBenchmarks/ @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  11. #6: #6: QUESTION THE STATUS QUO QUESTION THE STATUS QUO

    @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  12. Recap 1. we want fast as in fast server @pml0pes

    @pml0pes @pml0pes @pml0pes @pml0pes
  13. Recap 1. we want fast as in fast server 2.

    server as in a long-running process @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  14. Recap 1. we want fast as in fast server 2.

    server as in a long-running process 3. monitor rates, latency (and errors) @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  15. Recap 1. we want fast as in fast server 2.

    server as in a long-running process 3. monitor rates, latency (and errors) 4. JS is more than V8/node @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  16. Recap 1. we want fast as in fast server 2.

    server as in a long-running process 3. monitor rates, latency (and errors) 4. JS is more than V8/node 5. results must be peer-reviewed and verifiable @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  17. #7: #7: LOOK UNDER THE HOOD LOOK UNDER THE HOOD

    @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  18. const http = require('http'); http .createServer((request, response) => { response.end("Hello

    World\n"); }) .listen(8000); https://nodejs.org/en/blog/uncategorized/profiling-node-js @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  19. GRAAL GRAAL VS VS GRAAL.JS GRAAL.JS VS VS NODE.JS NODE.JS

    https://stefan-marr.de/papers/dls-marr-et-al-cross-language-compiler-benchmarking- are-we-fast-yet/ @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  20. Eclipse Vert.x Eclipse Vert.x is a polyglot reactive application framework

    that runs on the Java Virtual Machine https://vertx.io @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  21. GRAAL.JS GRAAL.JS + VERT.X + VERT.X = ES4X = ES4X

    @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  22. GRAAL.JS GRAAL.JS + VERT.X + VERT.X = ES4X = ES4X

    https://github.com/reactiverse/es4x @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  23. ES4X Features commonjs loader npm compatibility (no native modules for

    now) .d.ts definitions for the java APIs debug/profile using chrome-devtools https://reactiverse.io/es4x @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  24. CLOC stats Language files blank comment code Java 21 318

    584 1393 JavaScript 10 148 253 887 JSON 1 1 0 51 SUM: 32 467 837 2331 http://github.io/reactiverse/es4x @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  25. CONCLUSION CONCLUSION There's nothing wrong with JavaScript. Yes JavaScript is

    fast @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  26. CONCLUSION CONCLUSION There's nothing wrong with JavaScript. Yes JavaScript is

    fast You don't need to switch to Go/Rust/etc... @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes
  27. CONCLUSION CONCLUSION There's nothing wrong with JavaScript. Yes JavaScript is

    fast You don't need to switch to Go/Rust/etc... Dare to Experiment @pml0pes @pml0pes @pml0pes @pml0pes @pml0pes