At Busbud we are big fans of Node.js and we use it for most of our projects: frontend applications, backend APIs, background workers…
Busbud covered my trip to the Node.js Interactive 2017 conference in Vancouver to learn more about the future of Node.js and to talk with passionate developers of the community.
Here are some notes I took during some of my favorites talks:
The world runs on Node.js. Everybody is using Node (see more here).
Node 8 with a new version of V8 is going to be a major change for the Node.js platform.
Node is a first-class citizen in V8.
In the past the V8 team at Google was really focused on Chrome but
from now on the team is embracing Node.js:
it has dedicated people to improve Node.js support in V8, and no commit can land in the project if it is breaking Node.
Chris Bailey presented the tooling, and the instrumentation necessary to run highly scalable microservices.
It is nice to see many standards appearing around Node.js microservice deployment:
He also presented the appmetrics module which allows you to collect a lot of Node.js metrics and run CPU profiling. There are integrations with all the major monitoring systems (statsd, promotheus, etc.). Combined with the dashboard from appmetrics-dash, it is a good way to start monitoring your application perfomance.
You can also use yo nodeserver
to get a boilerplate Node.js microservice ready to deploy with all the instrumentation.
Bryan Hughes talk, about what part of your code is executed in the node main thread (JavaScript code and C++ sync code), what is executed in Node thread pool (async C++) and that some modules are using the C++ async primitive…
Modules using C++ primitives are different depending of the platform. For example, child_process
is using the C++ async primitive on Unix systems but thread pool on Windows.
Matteo Collina presented a simple way to profile and benchmark a server, using 0x (a tool to easily generate a flamegraph) and autocannon (an HTTP benchmarking tool).
He then showed us how to construct step by step a blazing fast HTTP framework:
JSON.stringify
with fast-json-stringify
schema-based JSON rendering;find-my-way
a router built on a radix-tree;Fastify
that implements a lot of optimizations for performance.For most uses, however, express
is fast enough, very popular and well supported.
Peter Marshall presented how the JavaScript execution pipeline changed in V8 with the arrival of Ignition and TurboFan.
Forget all the tricks you know about optimizing JavaScript code for V8: the best way to optimize code for newer versions of V8 is to not optimize at all and just write pragmatic JavaScript.
We also learned how V8 tries to optimize hot code (i.e. code frequently runned).
The old optimizing compiler was doing too much guessing and premature optimization, causing it to be often wrong and actually creating deoptimizations. The new optimizing compiler TurboFan resolves this problem by guessing less.
Debugging memory leaks is a problem that we had multiple times at Busbud, I was really excited to attend this talk.
After a brief introduction:
Don’t want any memory leaks? Don’t write any code or use anybody else’s!
Memory leaks happen when objects expected to be short-lived get attached to long-lived ones.
Ali goes on to talk about how it is hard to debug memory leaks, which metrics you need to monitor to detect JavaScript leaks (growing rss
and growing heapTotal
/heapUsed
) and native leaks (growing rss
, but stable heapTotal
/heapUsed
).
He showed us the tools available to detect and fix memory leaks:
What you need to remember from this talk: leaks are going to happen, be prepared and try these tools.
The Node.js Interactive 2017 was a great event, and I would like to thank the organizers for their hard work. It was a great occasion to meet the Node.js community and talk with other passionate actors of the ecosystem.
Source: Busbud engineering
There’s never been a better time to explore Canada’s stunning landscapes, vibrant cities, and cultural…
Love a good scenic ride? No matter what you're into—history, art, food, or just incredible…
When it comes to traveling in Mexico, most people assume flying is the fastest way…
Argentina is a vast and diverse country, with thousands of kilometers of roads connecting unique…
Traveling offers a world of experiences, but the costs can quickly add up, turning planning…
As the warm weather approaches, it's time to start planning your summer getaway. Whether you're…