Tests:
  • Object

    AخA
     
    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)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Object
    Map

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Chrome 130 on Windows
View result in a separate tab
Test name Executions per second
Object 533428.6 Ops/sec
Map 318316.2 Ops/sec