Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Browser:
Chrome 134
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Object cache
4.5 Ops/sec
Map cache
4.4 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'); } }