HTML Preparation code:
AخA
 
1
<script src='https://cdn.jsdelivr.net/npm/lodash@4.17.13/lodash.min.js'></script>
Script Preparation code:
 
var data = {
    id: 1,
    a: 1,
    b: '',
    c: '',
    d: false,
    e: '',
    f: 1,
    g: {
        h: 1,
        i: 'Dannag'
    },
    k: 1,
    l: 1,
}
Tests:
  • Lodash get

     
    _.get(data, 'g.i');
  • Native code

     
    const get = (o, path) => path.split('.').reduce((o = {}, key) => o[key], o);
    get(data, 'g.i')
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Lodash get
    Native code

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
Chrome 113 on Linux
View result in a separate tab
Test name Executions per second
Lodash get 2602701.2 Ops/sec
Native code 4512734.5 Ops/sec