Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
NodeJs in-memory-cache mechanism
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0
Browser:
Firefox 134
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
Object cache
2/s
Map cache
2/s
View exact numbers
Test name
Executions per second
✓
Object cache
2 Ops/sec
Map cache
2 Ops/sec
Tests:
Object cache
const CHUNK_SIZE = 100000; const cache = {}; for (let i = 0; i < CHUNK_SIZE; i++) { if (i % 2 === 0) { cache[i] = JSON.stringify({ TzId: i, Name: `Tz${i}`}); } } for (let i = 0; i < CHUNK_SIZE; i++) { if (cache.hasOwnProperty(i)) { console.log(cache[i]); } else { console.log('empty'); } }
Map cache
const CHUNK_SIZE = 100000; const cache = new Map(); for (let i = 0; i < CHUNK_SIZE; i++) { if (i % 2 === 0) { cache.set(i, JSON.stringify({ TzId: i, Name: `Tz${i}`})); } } for (let i = 0; i < CHUNK_SIZE; i++) { if (cache.has(i)) { console.log(cache.get(i)); } else { console.log('empty'); } }