Skip to content

Moro-JS/benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MoroJS Performance Benchmarks

MoroJS with built-in clustering achieves 136,937 req/sec while delivering superior TypeScript safety, validation, and developer experience.

Performance Results

Synthetic Benchmark (Industry Standard)

  • 136,937 req/sec with built-in clustering
  • 61,562 req/sec single-threaded
  • 6.81ms average latency with clustering (15.74ms single-threaded)
  • 0% error rate across all test scenarios

Real-World Application Performance

  • 52,992 req/sec - GET endpoints with full TypeScript validation
  • 37,863 req/sec - POST endpoints with Zod validation
  • 4-6ms latency in production scenarios

Framework Comparison

Metric Fastify MoroJS (Single) MoroJS (Clustered) MoroJS Advantage
Synthetic Performance 46,400 req/sec 61,562 req/sec 136,937 req/sec 195% faster
Latency 21.04ms 15.74ms 6.81ms 68% faster
TypeScript Support Plugin-based Native first-class Native first-class Built-in intelligence
Validation JSON Schema Zod integration Zod integration Faster + better DX
Error Handling Manual setup Intelligent defaults Intelligent defaults Zero-config safety
Real-world Testing Synthetic only Comprehensive suite Comprehensive suite Production-ready validation
Learning Curve Complex plugins Intuitive API Intuitive API Faster development

Why MoroJS is the New Performance Standard

Beyond Raw Speed

While other frameworks focus solely on synthetic benchmarks, MoroJS delivers superior performance across every metric that matters:

Performance:

  • 195% faster than Fastify with clustering
  • 33% faster than Fastify even in single-threaded mode
  • Built-in clustering achieves 136,937 req/sec with zero configuration

Safety: TypeScript-native with zero runtime overhead Validation: Zod integration that's faster than JSON Schema Developer Experience: Intelligent APIs that reduce bugs and development time Production Ready: Comprehensive error handling and edge case coverage

The Complete Package

// Fastify: Fast but basic
fastify.post('/users', {
  schema: { /* JSON Schema complexity */ }
}, handler)

// MoroJS: Faster AND better
app.post('/users', {
  schema: z.object({
    name: z.string(),
    email: z.string().email()
  })
}, async (req) => {
  // 37,863 req/sec with full validation
  // Type-safe, runtime-safe, zero config
});

Technical Advantages

Performance Optimizations

  1. Built-in clustering - Automatic multi-core utilization
  2. Zero-cost routing - Intelligent route matching without overhead
  3. Native TypeScript compilation - No runtime type checking penalties
  4. Optimized Zod integration - Faster validation than JSON Schema
  5. Smart bundling - Production builds eliminate dead code

Architecture Benefits

  • TypeScript-first design eliminates entire classes of runtime errors
  • Intelligent middleware system with automatic optimization
  • Production-hardened defaults based on real-world usage patterns
  • Comprehensive testing including edge cases other frameworks ignore
  • Built-in clustering with zero configuration needed

Benchmark Methodology

Industry Standard Comparison

Our benchmarks use the exact same methodology as Fastify's official benchmarks:

  • 100 concurrent connections
  • 40 second duration
  • 10 pipelining factor
  • Minimal "hello world" response

Real-World Testing

Unlike synthetic-only frameworks, MoroJS includes comprehensive real-world scenarios:

  • Multiple endpoint types (GET, POST, parameterized routes)
  • Production validation patterns
  • TypeScript compilation overhead
  • Error handling and edge cases
  • Multi-core utilization

Running the Benchmarks

Quick Start

# Install dependencies
npm install

# Start the test server
npm run hello-world

# Run the benchmark (in another terminal)
npm run bench

Expected Results:

  • ~136,937 req/sec with default clustering
  • ~61,562 req/sec without clustering

Available Tests

  • npm run hello-world - Standard benchmark with clustering
  • npm run benchmark:synthetic - Internal development benchmark

The MoroJS Advantage

Performance Without Compromise

Most frameworks force you to choose between speed and safety. MoroJS delivers both:

  • 195% faster than Fastify with built-in clustering
  • Superior real-world performance with validation and safety
  • TypeScript intelligence that prevents entire classes of bugs
  • Zero configuration for production-ready applications

Production Ready

While other frameworks excel in synthetic benchmarks but struggle in production, MoroJS is built for real applications:

  • Built-in clustering for maximum performance
  • Comprehensive error handling
  • Intelligent middleware system
  • Production-hardened defaults
  • Real-world performance validation

Framework Positioning

Fastify: Fast synthetic benchmarks, complex production setup MoroJS: Superior performance + built-in clustering + better developer experience

MoroJS represents the next generation of Node.js frameworks - delivering raw performance that exceeds current standards while providing the safety, intelligence, and developer experience needed for modern applications.


Ready to experience the fastest TypeScript-first framework? Run the benchmarks and see why MoroJS is setting the new performance standard.

About

MoroJS performance benchmarks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published