This analysis showcases the performance of these frameworks in side-by-side benchmarks, ultimately revealing the strengths and weaknesses of each in terms of speed. With Total.js consistently showing promise, this comparison will shed light on why it may be the ideal choice for projects where performance is a top priority.
Benchmarking Node.js Frameworks: selecting your framework for 2025!
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.
The Purpose of Benchmarking
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.
The Frameworks in This Analysis
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.
Benchmarking Methodology
Hardware and Testing Environment
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.
Testing Approach
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.
Metrics Considered
In addition to raw speed, we considered:
- Requests per Second – Measures how many requests each framework can handle per second.
- Transfer Rate – Amount of data transferred per second.
- Average and Maximum Latency – Indicates how quickly each framework responds under pressure.
Performance Results
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 |
Test it Yourself
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!
Key Observations and Insights
- 1. Koa Leads in Requests per Second: With a peak of 10,704 requests per second, Koa demonstrated the highest performance in terms of throughput and lowest average latency, making it ideal for high-concurrency applications.
- 2. Total.js Versions 4 and 5 Show Balance: Total.js v4 and v5 offer competitive speeds, with 7,494 and 7,010 requests per second, respectively. With low average latencies (21.83ms for v4 and 1.02ms for v5), Total.js stands as a balanced option, especially with v5 showcasing lower latency and an impressive 1.45MB transfer rate.
- 3. Express and Fastify—Popular, but Middle-Tier Performance: Express and Fastify, while popular for their ecosystem and flexibility, fell in the middle range, with lower requests per second (3,482 and 3,011) and higher latencies.
- 4. Feature-Rich but Slower Frameworks: Sails.js and Meteor offer extensive features but performed slower, with 672.70 and 248.57 requests per second, respectively. These frameworks may be suitable for applications where raw performance is less critical than feature sets.
- 5. Nest.js—Flexibility at a Cost: With 2,764 requests per second and a relatively high latency, Nest.js provides extensive abstraction layers but sacrifices some performance, making it ideal for complex applications that can tolerate slight performance overhead.
Total.js
- Balanced Performance
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.
- A unique design approch
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.
Conclusion
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.
Want to join the Total.js community?
- Total.js Enterprise: Total.js Enterprise
- GitHub: Total.js on GitHub
- Stack Overflow: Total.js questions on Stack Overflow
- Telegram: Total.js Telegram group
- WhatsApp: Total.js WhatsApp group
- Twitter: Total.js on Twitter
- Facebook: Total.js on Facebook
- LinkedIn: Total.js LinkedIn group
- Reddit: Total.js subreddit
- Discord: Total.js Discord server
- Slack: Total.js Slack channel
Other posts from Total.js Platform
- 2024-12-10Total.js UI Builder: How to upload files?
- 2024-12-04Performance Testing: Total.js vs. Koa
- 2024-12-03Total.js UI Builder: Creating a Form
- 2024-12-02November report 2024
- 2024-11-26Total.js V5: Schemas and Actions
- 2024-11-25QueryBuilder in Action Part 1
- 2024-11-01October report 2024
- 2024-10-22Performance Testing: Total.js vs. NestJS
- 2024-10-01September report 2024
- 2024-09-27Total.js UI Builder: #2 designing your first interface