Tests:
  • Object cache

    x
     
    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');
      }
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Object cache
    Map cache

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 14 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Chrome 135 on Windows
View result in a separate tab
Test name Executions per second
Object cache 3.0 Ops/sec
Map cache 2.8 Ops/sec