Skip to content

Benchmark

In-Memory Performance

Direct cache operations (no network overhead):

╔══════════════════════════════════════════════════════╗
║  Cache Operations (5000 ops, 1000 keys)            ║
╠══════════════════════════════════════════════════════╣
║  GET:   120,000+ ops/sec   avg: 0.008ms            ║
║  SET:   131,000+ ops/sec   avg: 0.008ms            ║
║  MIXED: 119,000+ ops/sec   (80% read, 20% write)   ║
╚══════════════════════════════════════════════════════╝

Data Distribution

╔══════════════════════════════════════════════════════╗
║  1000 keys across 3 nodes                          ║
║  node-0: 365 keys (36.5%) ██████████████████████   ║
║  node-1: 346 keys (34.6%) █████████████████████    ║
║  node-2: 289 keys (28.9%) ████████████████████     ║
╚══════════════════════════════════════════════════════╝

Real-World: Medusa.js Integration

Benchmark against running Medusa server with PostgreSQL:

TestThroughputAvgP50P95P99
GET /products (100 items)22 req/sec45ms44ms52ms97ms
GET /products?limit=1030 req/sec34ms33ms42ms56ms
10 concurrent requests6 req/sec171ms170ms206ms239ms

Key insight: Cache reads are 5600x faster than PostgreSQL queries.

How to Run

bash
# In-memory benchmark
npm run benchmark

# Memory usage test
npm run memory

# Medusa integration benchmark
cd medusa && node scripts/benchmark-real.js

Released under the MIT License.