In web development nowadays, picking the right framework can feel like choosing the perfect engine for a journey. As users demand lightning-fast interactions, it’s no longer just about building applications; it’s about crafting experiences that can scale effortlessly. Node.js frameworks have come a long way, from the simplicity of Express to the specialized efficiency of Total.js and Koa. Each framework addresses a different aspect of web development, whether it’s raw speed, scalability, or ease of use.
In this post, we’ll compare top frameworks through a series of benchmarks, sharing insights on performance and speed. With the results in hand, we’ll take a closer look at Total.js and why it’s worth considering in today's web driven request handling speed.
Performance in web applications is more than a luxury. It’s a necessity. As applications grow in complexity, users have little patience for delays or latency, with studies showing that even a second’s delay can reduce customer satisfaction. For developers, fast response times directly correlate with server efficiency, resource management, and cost-effectiveness. In a high-performance application, every millisecond counts, especially in applications with high traffic or intensive data processing requirements. Benchmarking frameworks on speed becomes an essential step in guiding framework selection.
This benchmark comparison focuses on a range of popular and up-and-coming Node.js frameworks:
This analysis showcases the performance of these frameworks in side-by-side benchmarks, revealing each framework's strengths and weaknesses in terms of speed, request handling, and latency.
All benchmarks were conducted on an iMac Intel Monterey with 12GB RAM, running Node.js v21. Using this consistent setup allowed us to standardize results across all frameworks.
We used wrk to simulate a high-concurrency environment with the following command:
Each framework handled requests for 5 seconds with 8 concurrent connections and 2 threads, simulating real-world application performance under load.
In addition to raw speed, we considered:
The table below presents the updated benchmarking results:
Rank | Framework | Requests/sec | Transfer/sec | Avg Latency | Max Latency |
---|---|---|---|---|---|
1 | Koa | 10,704.04 | 1.80MB | 0.95ms | 49.29ms |
2 | Hapi | 7,685.38 | 1.63MB | 1.15ms | 34.87ms |
3 | Total.js v4 | 7,494.29 | 2.39MB | 21.83ms | 499.69ms |
4 | Total.js v5 | 7,010.06 | 1.45MB | 1.02ms | 34.95ms |
5 | Express | 3,482.35 | 812.78KB | 2.54ms | 56.24ms |
6 | Fastify | 3,011.74 | 520.58KB | 5.92ms | 91.93ms |
7 | Nest.js | 2,764.15 | 534.47KB | 3.18ms | 55.42ms |
8 | Sails.js | 672.70 | 246.53KB | 12.55ms | 144.24ms |
9 | Meteor | 248.57 | 2.09MB | 34.17ms | 217.16ms |
Want to see how these frameworks perform firsthand? Download the benchmarking setup from the link below, unzip the package, and follow the instructions in the video to run the tests on your local machine.
This setup will walk you through benchmarking each framework so you can get a feel for their real-world performance. Happy testing!
Total.js consistently performed well, especially in its latest v5 iteration. With 7,010 requests per second, low latency, and minimal dependencies, Total.js achieves a balance between speed and modularity. While it may not dominate the spotlight, Total.js offers a compelling blend of modularity and performance that could make it a valuable choice for developers seeking efficiency and flexibility in a single package.
Peter Sirka, the founder of Total.js, commented on the results, acknowledging the trade-off between performance and the extensive features of the framework:
"That's OK... Total.js has more features implemented in the web server than Koa. That's logically going to reduce performance. But the numbers are still..."
This perspective highlights the balance Total.js strikes between providing a rich feature set and maintaining competitive performance, reinforcing its value proposition for developers seeking versatility without compromising on speed.
Total.js stands out in the Node.js ecosystem with its unique approach, shaped by a decade of dedicated development (since 2013). Known for being an "all-in-one" solution, Total.js is designed entirely in pure JavaScript without relying on external dependencies—a rarity among modern frameworks. This design reflects a strong commitment to Elon Musk’s "first principles" approach, where every aspect of web development is broken down to its fundamentals to ensure each component serves a true purpose.
This philosophy by means that Total.js avoids the conventional trend of integrating third-party libraries as dependencies. Instead, the developers of total.js have crafted every module from scratch, rigorously analyzing if existing norms in web development truly make sense or if they simply follow popular conventions. This emphasis on minimalism and independence gives Total.js a unique level of efficiency, stability, and control, making it one of the most optimized choices for high-performance, maintainable applications.
This benchmarking comparison reinforces Total.js's position as a strong contender in the Node.js ecosystem. While it may not have the lowest latency of Koa, Total.js offers an impressive mix of performance and features, with low dependency requirements and high throughput, making it a reliable choice for performance-focused applications.