HTML Preparation code:
x
 
1
2
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
 
var fs = {
    f1: {
      A: ["id1", "id2"],
    B: ["id1", "id2"],
    C: ["id1", "id2"],
    D: ["id1", "id2"],
    E: ["id1", "id2"],
    F: ["id1", "id2"],
    },
  f2: {
      A: ["id1", "id2"],
    B: ["id1", "id2"],
    C: ["id1", "id2"],
    D: ["id1", "id2"],
    E: ["id1", "id2"],
    F: ["id1", "id2"],
    },
  f3: {
      A: ["id1", "id2"],
    B: ["id1", "id2"],
    C: ["id1", "id2"],
    D: ["id1", "id2"],
    E: ["id1", "id2"],
    F: ["id1", "id2"],
    },
  f4: {
      A: ["id1", "id2"],
    B: ["id1", "id2"],
    C: ["id1", "id2"],
    D: ["id1", "id2"],
    E: ["id1", "id2"],
    F: ["id1", "id2"],
    },
  f5: {
      A: ["id1", "id2"],
    B: ["id1", "id2"],
    C: ["id1", "id2"],
    D: ["id1", "id2"],
    E: ["id1", "id2"],
    F: ["id1", "id2"],
    },
  f6: {
      A: ["id1", "id2"],
    B: ["id1", "id2"],
    C: ["id1", "id2"],
    D: ["id1", "id2"],
    E: ["id1", "id2"],
    F: ["id1", "id2"],
    },
  f7: {
      A: ["id1", "id2"],
    B: ["id1", "id2"],
    C: ["id1", "id2"],
    D: ["id1", "id2"],
    E: ["id1", "id2"],
    F: ["id1", "id2"],
    }
}
Tests:
  • Hybrid

     
    const e = (f, i, d) => {
      const c = _.get(fs, [f, i]);
      return c?.includes(d);
    };
    e("f7", "F", "id2")
  • Lodash

     
    const e = (f, i, d) => {
      const c = _.get(fs, [f, i]);
      return _.includes(c, d);
    };
    e("f7", "F", "id2")
  • Native JS

     
    const e = (f, i, d) => {
      const gf = fs[f];
      const gfc = gf ? gf[i] : [];
      const fd = gfc?.includes(d);
      return fd || false;
    };
      
    e("f7", "F", "id2")
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Hybrid
    Lodash
    Native JS

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:79.0) Gecko/20100101 Firefox/79.0
Firefox 79 on Mac OS X 10.15
View result in a separate tab
Test name Executions per second
Hybrid 17057582.0 Ops/sec
Lodash 5247213.0 Ops/sec
Native JS 73883312.0 Ops/sec