Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Memoization (Object, WeakMap)
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Android
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Object
729961.7 Ops/sec
Map
319668.7 Ops/sec
Tests:
Object
const memo = {} function fibonacci(n) { if (n <= 1) return n; if (memo[n]) return memo[n] memo[n] = fibonacci(n-1) + fibonacci(n-2) return memo[n] } fibonacci(40)
Map
const cache = new Map(); function fibonacci(n) { if (n <= 1) return n; if (cache.has(n)) { return cache.get(n); } cache.set(n, fibonacci(n-1) + fibonacci(n-2)) return cache.get(n) } fibonacci(40)