HTML Preparation code:
AخA
 
1
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
2
<script type="text/javascript">
3
  window.lodash = _;
4
  _ = null;
5
</script>
6
<script src='https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.9.1/underscore-min.js'></script>
7
<script type="text/javascript">
8
  window.underscore = _;
9
  _ = null;
10
</script>
11
<script src="https://cdn.jsdelivr.net/npm/react-fast-compare@latest/index.js"></script>
Script Preparation code:
x
 
// 3 levels deep
window.foo3 = { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 2 } } };
window.bar3 = { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 4 } } };
// 4 levels deep
window.foo4 = { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 2 } } } };
window.bar4 = { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 4 } } } };
// 5 levels deep
window.foo5 = { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 2 } } } } };
window.bar5 = { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 4 } } } } };
Tests:
  • lodash Level 5

     
    lodash.isEqual(window.foo5, window.bar5)
  • underscore Level 5

     
    underscore.isEqual(window.foo5, window.foo5)
  • JSON.stringify Level 5

     
    JSON.stringify(window.foo5) === JSON.stringify(window.bar5);
  • react-fast-compare Level 5

     
    equal(window.foo5, window.foo5)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    lodash Level 5
    underscore Level 5
    JSON.stringify Level 5
    react-fast-compare Level 5

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 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
lodash Level 5 460204.7 Ops/sec
underscore Level 5 78929840.0 Ops/sec
JSON.stringify Level 5 1742588.5 Ops/sec
react-fast-compare Level 5 92382880.0 Ops/sec