Skip to content

Benchmarks & Cloud Financial ROI

TriCache is engineered and benchmarked against high-concurrency microservice and edge workloads.


In-Memory Warm Read Throughput

Measured via native Node.js benchmarks (pnpm bench) with V8 garbage collection exposure on an 8-core machine:

Cache EngineArchitectureThroughput (ops/sec)Latency (ns/op)Allocation Overhead
TriCache (L1 RAM)W-TinyLFU + Segmented LRU2,810,000 ops/s356 ns0 bytes (zero-alloc)
lru-cache v11Doubly-linked list LRU2,150,000 ops/s465 nsMinimal
@neshca/cache-handlerIn-Memory + Redis Adapter820,000 ops/s1,219 nsMedium (wrapper overhead)
keyv (in-memory)Map wrapper1,400,000 ops/s714 nsLow
Single-Tier RedisLocal VPC Network Hop8,500 ops/s1,200,000 ns (1.2 ms)Network TCP socket

Warm in-memory reads in TriCache run at 2.81 million ops/sec, bypassing V8 deserialization by referencing hot cached JS primitives.


Tier Latency Hierarchy

Caching Tiers Latency Hierarchy

Latency Hierarchy Overview
┌─────────────────────────────────────────────────────────────┐
│  Tier 1: L1 RAM (W-TinyLFU)                ~350 ns          │
│  Tier 1.5: /dev/shm (tmpfs off-heap RAM)   ~20 µs           │
│  Tier 2: L2 Redis (Network VPC)            ~1,200 µs (1.2ms)│
│  Tier 3: Database / Upstream API           ~50,000 µs (50ms)│
└─────────────────────────────────────────────────────────────┘

Cloud ROI & Adversarial Simulation

To evaluate real-world infrastructure impact without theoretical bias, TriCache includes a deterministic cloud simulation based on an adversarial Zipfian workload (N=10,000 keys, skew s=0.99, 100,000 requests, 15% novel cold-tail misses, 5% writes, 2KB payloads, seeded via Mulberry32 0xDEADBEEF).

Run the simulation locally:

bash
pnpm bench:roi

1. Operational Throughput & Tier Distribution

Operational Throughput & Tier Distribution

Throughput & Tier Distribution Data
+--------------------------+---------------------+---------------------+
| Metric                   | Single-Tier Redis   | TriCache 3-Tier     |
+--------------------------+---------------------+---------------------+
| L1 RAM Hits              | 0 (0.0%)            | 48,455 (48.5%)      |
| L1.5 /dev/shm Disk Hits  | 0 (0.0%)            | 14,004 (14.0%)      |
| L2 Redis Hits            | 72,901 (72.9%)      | 10,442 (10.4%)      |
| DB Misses (fetchFn)      | 22,082 (22.1%)      | 22,082 (22.1%)      |
| Total Redis Commands     | 122,082             | 59,623              |
| Redis Command Reduction  | Baseline (0.0%)     | -51.2%              |
+--------------------------+---------------------+---------------------+

2. Latency Percentile Compression

Latency Percentile Compression

Percentile Compression Data
+--------------------------+---------------------+---------------------+
| Percentile               | Single-Tier Redis   | TriCache 3-Tier     |
+--------------------------+---------------------+---------------------+
| p50 (Median)             | 1.50 ms             | 0.08 ms (18.7x)     |
| p95                      | 51.50 ms            | 50.00 ms            |
| p99                      | 51.50 ms            | 50.00 ms            |
+--------------------------+---------------------+---------------------+

3. AWS Infrastructure Financial Savings (100M req/day fleet)

AWS Infrastructure Financial Savings

Financial Savings Breakdown
+-------------------------------------+------------------+------------------+
| Cloud Infrastructure Line Item      | Single-Tier      | TriCache 3-Tier  |
+-------------------------------------+------------------+------------------+
| AWS ElastiCache Cluster Instance    | 3x r6g.xlarge    | 2x r6g.large     |
| ElastiCache Annual Instance Cost    | $10,459.44       | $3,486.48        |
| Monthly VPC Inter-AZ Bandwidth      | 5,722 GB/mo      | 2,148 GB/mo      |
| Annual AWS VPC Data Transfer Cost   | $686.65          | $257.77          |
+-------------------------------------+------------------+------------------+
| TOTAL ANNUAL CLOUD INFRASTRUCTURE   | $11,146.09       | $3,744.25        |
+-------------------------------------+------------------+------------------+
| NET ANNUAL SAVINGS WITH TRICACHE    | ->               | $7,401.83        |
+-------------------------------------+------------------+------------------+

Executive Takeaway

TriCache absorbs 51.2% of Redis command volume directly in local RAM and /dev/shm, dropping median latency by 18.7× and saving $7,401.83/year per cluster while protecting upstream databases from stampedes.


Granular Micro-Benchmarks

Data collected via pnpm bench under Node.js 22:

1. Bloom Filter Probe Cost

The WASM Bloom filter is O(k=7) per probe. Definite misses abort without accessing the V8 Map:

OperationThroughputLatencyNotes
Definite miss (never set)5,360,000 ops/s187 ns7 hash rounds bit check return null
Hit path (confirmed present)3,220,000 ops/s310 ns7 hash rounds Map.get return cached entry

2. Serialization Throughput (msgpackr 2.1.0)

Payload SizeThroughputLatency
128 B827,700 ops/s1.21 µs
256 B706,200 ops/s1.42 µs
512 B625,800 ops/s1.60 µs
1,024 B (1 KB)472,300 ops/s2.12 µs
4,096 B (4 KB)228,600 ops/s4.37 µs

3. Cryptographic Ciphers & Obfuscation (L2 Redis & Disk)

ModePayload SizeEncrypt LatencyDecrypt LatencyThroughput
AES-256-GCM64 B7.12 µs6.43 µs155,500 ops/s
AES-256-GCM4 KB17.12 µs20.84 µs58,400 ops/s
AES-128-GCM64 B6.72 µs5.78 µs173,000 ops/s
AES-128-CTR64 B5.32 µs5.08 µs196,900 ops/s
XOR Obfuscation64 B (32-bit CPU path)0.41 µs (412 ns)0.47 µs (476 ns)2,430,000 ops/s

4. L1 Memory Iteration (500 live entries)

MethodThroughputLatencyNotes
cache.keys()26,600 ops/s37.53 µsNo [key, entry] tuple allocation
cache.values()35,500 ops/s28.19 µsDirect yield* delegation
cache.entries()24,000 ops/s41.73 µsStripped namespace keys
cache.scan(fn)210,000 ops/s4.76 µsZero-alloc direct index scan