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 (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
Test name
Executions per second
Object cache
1.9 Ops/sec
Map cache
1.8 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'); } }