How We Optimized Concurrency Using Node.js at Skeelo
Article Summary
Skeelo's engineering team achieved a 30% performance boost by rethinking one simple thing: when NOT to use await in Node.js.
The team discovered they were blocking their main thread unnecessarily by awaiting operations that didn't need immediate responses. By strategically using callbacks and letting Node's Event Loop handle non-critical tasks, they dramatically improved their app's responsiveness.
Key Takeaways
- Reduced login function execution time from 500ms to 350ms (30% faster)
- Fire and forget pattern for queue events keeps main thread unblocked
- Node's Event Loop handles background tasks without blocking I/O operations
- Strategic use of .then() and .catch() enables true concurrency
Not every async operation needs await: identifying which tasks can run in the background cut response times by 30%.
About This Article
Skeelo's login function took 500ms total because the team was awaiting all operations in sequence. This included publishing to a notification queue, which didn't actually need to finish before responding to the user.
Nicolas Frasson's team removed the await from the queue publishing step. They added .catch() for error handling instead, letting Node.js handle the task in the background without blocking anything.
Login now completes in 350ms. The notification queue processes asynchronously in the background, so user authentication responses aren't delayed.