Native Object.entries vs Lodash toPairs (v2)

Revision 2 of this benchmark created on


Description

Compare the performance of the native browser function to Lodash.

Preparation HTML

<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.15/lodash.min.js'></script>

Setup

const smallDict = { a: 1, b: 2, c: 3 };

const largeDict = Object.fromEntries(
  Array.from({ length: 100 }, (_, i) =>
    [i, { value: i, isEven: i % 2 === 0 }]))

Test runner

Ready to run.

Testing in
TestOps/sec
[Native] Object.entries [Small]
Object.entries(smallDict);
ready
[Lodash] _.toPairs [Small]
_.toPairs(smallDict);
ready
[Native] Object.entries [Large]
Object.entries(largeDict);
ready
[Lodash] _.toPairs [Large]
_.toPairs(largeDict);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.