Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate (broken) benchmarks to tinybench #107

Merged
merged 8 commits into from
May 18, 2024

Conversation

magne4000
Copy link
Contributor

Benchmarks do not seem to work anymore (node 18), and as karma is deprecated, migrating to tinybench seems like a good alternative.

Webpack bundling...
Error: ENOENT: no such file or directory, open '/tmp/_karma_webpack_528370/array.bench.885065150.js'
    at Object.openSync (node:fs:596:3)
    at Object.readFileSync (node:fs:464:35)
    at /home/magne/workspace/on-change/node_modules/.pnpm/[email protected][email protected][email protected]_/node_modules/karma-webpack/lib/webpack/plugin.js:22:66
    at Array.forEach (<anonymous>)
    at /home/magne/workspace/on-change/node_modules/.pnpm/[email protected][email protected][email protected]_/node_modules/karma-webpack/lib/webpack/plugin.js:17:29
    at Hook.eval [as callAsync] (eval at create (/home/magne/workspace/on-change/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/magne/workspace/on-change/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/Hook.js:18:14)
    at onCompiled (/home/magne/workspace/on-change/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/Compiler.js:498:21)
    at /home/magne/workspace/on-change/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/Compiler.js:1329:17
    at Hook.eval [as callAsync] (eval at create (/home/magne/workspace/on-change/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)

Machine info

System:
  Kernel: 6.8.9-arch1-2 arch: x86_64 bits: 64 compiler: gcc v: 14.1.1
  Desktop: KDE Plasma v: 6.0.4 Distro: EndeavourOS base: Arch Linux
Machine:
  Type: Desktop Mobo: ASUSTeK model: PRIME X470-PRO v: Rev X.0x
    serial: <superuser required> UEFI: American Megatrends v: 6223
    date: 03/19/2024
CPU:
  Info: 8-core model: AMD Ryzen 7 5800X bits: 64 type: MT MCP arch: Zen 3+
    rev: 0 cache: L1: 512 KiB L2: 4 MiB L3: 32 MiB
  Speed (MHz): avg: 3927 high: 4667 min/max: 2200/4850 boost: enabled cores:
    1: 3807 2: 3716 3: 4667 4: 3739 5: 3714 6: 3737 7: 4291 8: 3660 9: 3738
    10: 3740 11: 4633 12: 3737 13: 3739 14: 3739 15: 4458 16: 3731
    bogomips: 121641
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Info:
  Memory: total: 32 GiB available: 31.25 GiB used: 10.98 GiB (35.1%)
  Processes: 383 Uptime: 4h 32m Init: systemd
  Packages: 1093 Compilers: clang: 17.0.6 gcc: 14.1.1 Shell: fish v: 3.7.1
    inxi: 3.3.34

Benchmarks

on-change init with object

┌─────────┬───────────────┬──────────────┬───────────────────┬──────────┬─────────┐
│ (index) │   Task Name   │   ops/sec    │ Average Time (ns) │  Margin  │ Samples │
├─────────┼───────────────┼──────────────┼───────────────────┼──────────┼─────────┤
│    0    │  'new Proxy'  │ '17 329 269' │ 57.70583653063863 │ '±0.06%' │ 8664635 │
│    1    │ 'no options'  │ '3 681 361'  │ 271.6386087493435 │ '±0.20%' │ 1840681 │
│    2    │ 'pathAsArray' │ '3 190 043'  │ 313.4753462785616 │ '±0.89%' │ 1595022 │
│    3    │  'fat-arrow'  │ '3 514 267'  │ 284.5543587706623 │ '±1.07%' │ 1757134 │
└─────────┴───────────────┴──────────────┴───────────────────┴──────────┴─────────┘

on-change with object, read

┌─────────┬───────────────────────────────────────┬──────────────┬────────────────────┬──────────┬─────────┐
│ (index) │               Task Name               │   ops/sec    │ Average Time (ns)  │  Margin  │ Samples │
├─────────┼───────────────────────────────────────┼──────────────┼────────────────────┼──────────┼─────────┤
│    0    │         '(small) no options'          │ '9 072 660'  │ 110.22124674345426 │ '±0.04%' │ 4536331 │
│    1    │          '(small) isShallow'          │ '8 348 605'  │ 119.78048149227202 │ '±0.13%' │ 4174303 │
│    2    │         '(small) pathAsArray'         │ '8 238 275'  │ 121.38463007202085 │ '±0.28%' │ 4119139 │
│    3    │        '(small) ignoreSymbols'        │ '8 337 583'  │ 119.93882235829814 │ '±0.43%' │ 4168792 │
│    4    │      '(small) ignoreUnderscores'      │ '8 239 540'  │ 121.36598737288611 │ '±0.48%' │ 4119771 │
│    5    │       '(small) ignoreDetached'        │ '8 499 510'  │ 117.65383587909496 │ '±0.06%' │ 4249756 │
│    6    │         '(small) empty Proxy'         │ '10 836 691' │ 92.27908402517168  │ '±0.31%' │ 5418346 │
│    7    │ '(small) native      _______________' │ '17 919 864' │ 55.80399246437383  │ '±0.33%' │ 8959933 │
│    8    │         '(large) no options'          │ '9 713 659'  │ 102.94781336370873 │ '±0.04%' │ 4856830 │
│    9    │          '(large) isShallow'          │ '10 019 597' │ 99.80441314216507  │ '±0.04%' │ 5009799 │
│   10    │         '(large) pathAsArray'         │ '10 238 049' │ 97.67485464711591  │ '±0.04%' │ 5119025 │
│   11    │        '(large) ignoreSymbols'        │ '10 194 759' │ 98.08960961010054  │ '±0.06%' │ 5097380 │
│   12    │      '(large) ignoreUnderscores'      │ '10 513 022' │ 95.12012250023277  │ '±0.06%' │ 5256512 │
│   13    │       '(large) ignoreDetached'        │ '10 417 359' │  95.9936150351958  │ '±0.06%' │ 5208680 │
│   14    │         '(large) empty Proxy'         │ '12 347 756' │ 80.98637188127606  │ '±0.03%' │ 6173879 │
│   15    │           '(large) native '           │ '18 138 405' │ 55.13163912515246  │ '±0.11%' │ 9069203 │
└─────────┴───────────────────────────────────────┴──────────────┴────────────────────┴──────────┴─────────┘

on-change with object, read nested

┌─────────┬───────────────────────────────────────┬──────────────┬────────────────────┬──────────┬─────────┐
│ (index) │               Task Name               │   ops/sec    │ Average Time (ns)  │  Margin  │ Samples │
├─────────┼───────────────────────────────────────┼──────────────┼────────────────────┼──────────┼─────────┤
│    0    │         '(small) no options'          │ '4 129 643'  │  242.151670381143  │ '±0.04%' │ 2064822 │
│    1    │          '(small) isShallow'          │ '6 271 945'  │ 159.4401541659617  │ '±0.03%' │ 3135974 │
│    2    │         '(small) pathAsArray'         │ '3 347 836'  │ 298.70033137604497 │ '±0.80%' │ 1674201 │
│    3    │        '(small) ignoreSymbols'        │ '4 063 451'  │ 246.09620829325988 │ '±0.03%' │ 2031726 │
│    4    │      '(small) ignoreUnderscores'      │ '4 082 444'  │ 244.9512725918427  │ '±0.08%' │ 2041223 │
│    5    │       '(small) ignoreDetached'        │ '3 733 331'  │ 267.8572555157549  │ '±0.07%' │ 1866666 │
│    6    │         '(small) empty Proxy'         │ '10 243 589' │ 97.62203102373151  │ '±0.09%' │ 5121795 │
│    7    │ '(small) native      _______________' │ '16 800 239' │ 59.522960599437134 │ '±0.04%' │ 8400120 │
│    8    │         '(large) no options'          │ '4 108 681'  │ 243.38709350930736 │ '±0.06%' │ 2054341 │
│    9    │          '(large) isShallow'          │ '5 743 893'  │ 174.09794153619333 │ '±0.06%' │ 2871947 │
│   10    │         '(large) pathAsArray'         │ '3 166 939'  │ 315.7623043879034  │ '±1.27%' │ 1583623 │
│   11    │        '(large) ignoreSymbols'        │ '4 022 738'  │ 248.58689498319538 │ '±0.10%' │ 2011370 │
│   12    │      '(large) ignoreUnderscores'      │ '4 068 381'  │ 245.79796658613526 │ '±0.03%' │ 2034191 │
│   13    │       '(large) ignoreDetached'        │ '3 890 980'  │ 257.00460301272267 │ '±0.03%' │ 1945491 │
│   14    │         '(large) empty Proxy'         │ '11 297 944' │  88.5116752309895  │ '±0.03%' │ 5648973 │
│   15    │           '(large) native '           │ '15 942 247' │ 62.72641194457318  │ '±0.04%' │ 7971124 │
└─────────┴───────────────────────────────────────┴──────────────┴────────────────────┴──────────┴─────────┘

on-change with object, write

┌─────────┬───────────────────────────────────────┬──────────────┬────────────────────┬──────────┬─────────┐
│ (index) │               Task Name               │   ops/sec    │ Average Time (ns)  │  Margin  │ Samples │
├─────────┼───────────────────────────────────────┼──────────────┼────────────────────┼──────────┼─────────┤
│    0    │         '(small) no options'          │ '3 444 318'  │ 290.3332020242049  │ '±0.04%' │ 1722160 │
│    1    │          '(small) isShallow'          │ '3 453 492'  │ 289.5619524718804  │ '±0.04%' │ 1726747 │
│    2    │         '(small) pathAsArray'         │ '2 860 123'  │  349.635193463283  │ '±0.88%' │ 1430062 │
│    3    │        '(small) ignoreSymbols'        │ '3 424 192'  │ 292.03967455680686 │ '±0.05%' │ 1712097 │
│    4    │      '(small) ignoreUnderscores'      │ '3 586 060'  │ 278.85754012568856 │ '±0.07%' │ 1793031 │
│    5    │       '(small) ignoreDetached'        │ '3 329 852'  │ 300.31357238239093 │ '±0.05%' │ 1664927 │
│    6    │         '(small) empty Proxy'         │ '3 082 623'  │ 324.39896970844154 │ '±0.06%' │ 1541312 │
│    7    │ '(small) native      _______________' │ '16 129 808' │ 61.99701654644691  │ '±0.12%' │ 8064905 │
│    8    │         '(large) no options'          │ '3 442 259'  │ 290.50689132294366 │ '±0.06%' │ 1721130 │
│    9    │          '(large) isShallow'          │ '3 558 793'  │ 280.9941418484273  │ '±0.08%' │ 1779397 │
│   10    │         '(large) pathAsArray'         │ '2 960 056'  │ 337.8313770047706  │ '±0.57%' │ 1480029 │
│   11    │        '(large) ignoreSymbols'        │ '3 522 146'  │ 283.91774491505896 │ '±0.06%' │ 1761074 │
│   12    │      '(large) ignoreUnderscores'      │ '3 536 058'  │ 282.8007144386503  │ '±0.05%' │ 1768030 │
│   13    │       '(large) ignoreDetached'        │ '3 330 273'  │ 300.2756234482711  │ '±0.29%' │ 1665137 │
│   14    │         '(large) empty Proxy'         │ '3 269 999'  │ 305.8104347676859  │ '±0.23%' │ 1635000 │
│   15    │           '(large) native '           │ '16 305 927' │ 61.327392981818534 │ '±0.23%' │ 8152964 │
└─────────┴───────────────────────────────────────┴──────────────┴────────────────────┴──────────┴─────────┘

on-change with object, write nested

┌─────────┬───────────────────────────────────────┬──────────────┬────────────────────┬──────────┬─────────┐
│ (index) │               Task Name               │   ops/sec    │ Average Time (ns)  │  Margin  │ Samples │
├─────────┼───────────────────────────────────────┼──────────────┼────────────────────┼──────────┼─────────┤
│    0    │         '(small) no options'          │ '1 942 159'  │ 514.8906943079812  │ '±0.35%' │ 971080  │
│    1    │          '(small) isShallow'          │ '5 642 125'  │ 177.23817905485848 │ '±0.15%' │ 2821063 │
│    2    │         '(small) pathAsArray'         │ '1 804 130'  │ 554.2837365920693  │ '±0.36%' │ 902066  │
│    3    │        '(small) ignoreSymbols'        │ '1 958 849'  │ 510.5037596569761  │ '±0.07%' │ 979425  │
│    4    │      '(small) ignoreUnderscores'      │ '2 018 440'  │ 495.4319712698541  │ '±0.05%' │ 1009221 │
│    5    │       '(small) ignoreDetached'        │ '1 784 863'  │ 560.2667804019381  │ '±0.33%' │ 892432  │
│    6    │         '(small) empty Proxy'         │ '9 016 114'  │ 110.91252068677612 │ '±0.04%' │ 4508058 │
│    7    │ '(small) native      _______________' │ '14 643 046' │ 68.29180075792478  │ '±0.04%' │ 7321524 │
│    8    │         '(large) no options'          │ '2 040 503'  │ 490.07506735004574 │ '±0.23%' │ 1020252 │
│    9    │          '(large) isShallow'          │ '5 668 103'  │ 176.42584858406335 │ '±0.34%' │ 2834053 │
│   10    │         '(large) pathAsArray'         │ '1 873 513'  │ 533.7563674985945  │ '±0.25%' │ 936757  │
│   11    │        '(large) ignoreSymbols'        │ '2 096 794'  │ 476.91848201400893 │ '±0.28%' │ 1048398 │
│   12    │      '(large) ignoreUnderscores'      │ '2 132 701'  │ 468.8887703549428  │ '±0.06%' │ 1066351 │
│   13    │       '(large) ignoreDetached'        │ '1 852 248'  │ 539.8843257649899  │ '±0.74%' │ 926125  │
│   14    │         '(large) empty Proxy'         │ '9 900 921'  │ 101.00070251945691 │ '±0.18%' │ 4950461 │
│   15    │           '(large) native '           │ '15 443 237' │ 64.75326217281895  │ '±0.07%' │ 7721619 │
└─────────┴───────────────────────────────────────┴──────────────┴────────────────────┴──────────┴─────────┘

on-change with object, toString

┌─────────┬───────────────────────────────────────┬──────────────┬────────────────────┬──────────┬─────────┐
│ (index) │               Task Name               │   ops/sec    │ Average Time (ns)  │  Margin  │ Samples │
├─────────┼───────────────────────────────────────┼──────────────┼────────────────────┼──────────┼─────────┤
│    0    │         '(small) no options'          │ '4 065 282'  │ 245.98535707444066 │ '±0.04%' │ 2032642 │
│    1    │          '(small) isShallow'          │ '3 571 609'  │ 279.9858383217077  │ '±0.04%' │ 1785805 │
│    2    │         '(small) pathAsArray'         │ '4 048 587'  │ 246.99974048009838 │ '±0.08%' │ 2024294 │
│    3    │        '(small) ignoreSymbols'        │ '4 014 943'  │ 249.06951476577063 │ '±0.11%' │ 2007472 │
│    4    │      '(small) ignoreUnderscores'      │ '4 026 875'  │ 248.33146416494324 │ '±0.04%' │ 2013438 │
│    5    │       '(small) ignoreDetached'        │ '4 042 987'  │ 247.3418563474324  │ '±0.06%' │ 2021494 │
│    6    │         '(small) empty Proxy'         │ '5 111 044'  │ 195.65470683420986 │ '±2.07%' │ 2555523 │
│    7    │ '(small) native      _______________' │ '14 667 537' │  68.1777724154335  │ '±0.12%' │ 7333769 │
│    8    │         '(large) no options'          │ '4 125 557'  │ 242.3914535705914  │ '±0.10%' │ 2062779 │
│    9    │          '(large) isShallow'          │ '3 331 201'  │ 300.19200037441874 │ '±0.04%' │ 1665601 │
│   10    │         '(large) pathAsArray'         │ '4 127 725'  │ 242.2642003868496  │ '±0.08%' │ 2063863 │
│   11    │        '(large) ignoreSymbols'        │ '3 936 630'  │ 254.02435058600364 │ '±0.08%' │ 1968316 │
│   12    │      '(large) ignoreUnderscores'      │ '4 311 603'  │ 231.93226795639038 │ '±0.04%' │ 2155802 │
│   13    │       '(large) ignoreDetached'        │ '4 386 609'  │ 227.9664749631743  │ '±0.06%' │ 2193305 │
│   14    │         '(large) empty Proxy'         │ '5 968 894'  │ 167.53520432517823 │ '±1.30%' │ 2984448 │
│   15    │           '(large) native '           │ '11 629 287' │  85.9897890817742  │ '±0.05%' │ 5814647 │
└─────────┴───────────────────────────────────────┴──────────────┴────────────────────┴──────────┴─────────┘

on-change init with array

┌─────────┬───────────────┬──────────────┬────────────────────┬──────────┬─────────┐
│ (index) │   Task Name   │   ops/sec    │ Average Time (ns)  │  Margin  │ Samples │
├─────────┼───────────────┼──────────────┼────────────────────┼──────────┼─────────┤
│    0    │  'new Proxy'  │ '16 270 770' │ 61.45990299607239  │ '±0.03%' │ 8135386 │
│    1    │ 'no options'  │ '3 825 815'  │ 261.38216495089154 │ '±0.26%' │ 1912908 │
│    2    │ 'pathAsArray' │ '3 065 278'  │ 326.23461929894376 │ '±1.19%' │ 1532640 │
│    3    │  'fat-arrow'  │ '3 301 127'  │ 302.9267693356128  │ '±1.18%' │ 1650564 │
└─────────┴───────────────┴──────────────┴────────────────────┴──────────┴─────────┘

on-change with array, read

┌─────────┬───────────────────────────────────────┬──────────────┬────────────────────┬──────────┬─────────┐
│ (index) │               Task Name               │   ops/sec    │ Average Time (ns)  │  Margin  │ Samples │
├─────────┼───────────────────────────────────────┼──────────────┼────────────────────┼──────────┼─────────┤
│    0    │         '(small) no options'          │ '2 620 122'  │ 381.6615680678603  │ '±0.05%' │ 1310062 │
│    1    │          '(small) isShallow'          │ '3 318 901'  │ 301.3045330251935  │ '±0.04%' │ 1659451 │
│    2    │         '(small) pathAsArray'         │ '2 323 582'  │ 430.3699052943847  │ '±0.40%' │ 1161793 │
│    3    │         '(small) empty Proxy'         │ '7 015 432'  │ 142.54288697555452 │ '±0.04%' │ 3507717 │
│    4    │ '(small) native      _______________' │ '19 098 474' │ 52.360201907104255 │ '±0.04%' │ 9549238 │
│    5    │         '(large) no options'          │ '2 779 551'  │ 359.77023755169665 │ '±0.04%' │ 1389776 │
│    6    │          '(large) isShallow'          │ '3 293 620'  │  303.617259607374  │ '±0.04%' │ 1646811 │
│    7    │         '(large) pathAsArray'         │ '2 336 886'  │ 427.91975520051955 │ '±0.85%' │ 1168445 │
│    8    │         '(large) empty Proxy'         │ '6 676 826'  │ 149.7717428083343  │ '±0.05%' │ 3338414 │
│    9    │           '(large) native '           │ '19 155 207' │ 52.20512413289268  │ '±0.05%' │ 9577605 │
└─────────┴───────────────────────────────────────┴──────────────┴────────────────────┴──────────┴─────────┘

on-change with array, read nested

┌─────────┬───────────────────────────────────────┬──────────────┬────────────────────┬──────────┬─────────┐
│ (index) │               Task Name               │   ops/sec    │ Average Time (ns)  │  Margin  │ Samples │
├─────────┼───────────────────────────────────────┼──────────────┼────────────────────┼──────────┼─────────┤
│    0    │         '(small) no options'          │ '2 277 698'  │ 439.03969102003276 │ '±0.05%' │ 1138850 │
│    1    │          '(small) isShallow'          │ '3 185 331'  │ 313.9390814969579  │ '±0.04%' │ 1592666 │
│    2    │         '(small) pathAsArray'         │ '1 958 827'  │ 510.50960334742336 │ '±0.45%' │ 979414  │
│    3    │         '(small) empty Proxy'         │ '6 295 992'  │ 158.83118160433705 │ '±0.04%' │ 3147997 │
│    4    │ '(small) native      _______________' │ '15 734 845' │ 63.553212591134184 │ '±0.03%' │ 7867423 │
│    5    │         '(large) no options'          │ '2 219 627'  │ 450.5261037308003  │ '±0.06%' │ 1109815 │
│    6    │          '(large) isShallow'          │ '3 188 219'  │ 313.65470295196224 │ '±0.07%' │ 1594110 │
│    7    │         '(large) pathAsArray'         │ '1 979 698'  │ 505.1274670581237  │ '±0.75%' │ 989850  │
│    8    │         '(large) empty Proxy'         │ '6 336 663'  │ 157.81176426480425 │ '±0.17%' │ 3168332 │
│    9    │           '(large) native '           │ '14 749 694' │ 67.79801449605087  │ '±0.08%' │ 7374848 │
└─────────┴───────────────────────────────────────┴──────────────┴────────────────────┴──────────┴─────────┘

on-change with array, write

┌─────────┬───────────────────────────────────────┬──────────────┬────────────────────┬──────────┬─────────┐
│ (index) │               Task Name               │   ops/sec    │ Average Time (ns)  │  Margin  │ Samples │
├─────────┼───────────────────────────────────────┼──────────────┼────────────────────┼──────────┼─────────┤
│    0    │         '(small) no options'          │ '2 413 132'  │ 414.3990584517075  │ '±0.12%' │ 1206567 │
│    1    │          '(small) isShallow'          │ '2 460 201'  │ 406.4707571944422  │ '±0.03%' │ 1230101 │
│    2    │         '(small) pathAsArray'         │ '2 113 117'  │ 473.23451294001995 │ '±0.26%' │ 1056559 │
│    3    │         '(small) empty Proxy'         │ '2 183 638'  │ 457.9513038787474  │ '±0.04%' │ 1091820 │
│    4    │ '(small) native      _______________' │ '15 952 060' │ 62.687825691941676 │ '±0.10%' │ 7976031 │
│    5    │         '(large) no options'          │ '2 481 534'  │ 402.9763896772135  │ '±0.06%' │ 1240768 │
│    6    │          '(large) isShallow'          │ '2 471 864'  │ 404.55299672723777 │ '±0.10%' │ 1235933 │
│    7    │         '(large) pathAsArray'         │ '2 125 545'  │ 470.4674114072562  │ '±0.28%' │ 1062773 │
│    8    │         '(large) empty Proxy'         │ '2 149 647'  │ 465.1925700266024  │ '±0.07%' │ 1074824 │
│    9    │           '(large) native '           │ '15 757 198' │ 63.46305891844217  │ '±0.05%' │ 7878600 │
└─────────┴───────────────────────────────────────┴──────────────┴────────────────────┴──────────┴─────────┘

on-change with array, write nested

┌─────────┬───────────────────────────────────────┬──────────────┬────────────────────┬──────────┬─────────┐
│ (index) │               Task Name               │   ops/sec    │ Average Time (ns)  │  Margin  │ Samples │
├─────────┼───────────────────────────────────────┼──────────────┼────────────────────┼──────────┼─────────┤
│    0    │         '(small) no options'          │ '1 507 349'  │ 663.4159350668442  │ '±0.63%' │ 753675  │
│    1    │          '(small) isShallow'          │ '3 061 435'  │ 326.6441169754454  │ '±0.05%' │ 1530718 │
│    2    │         '(small) pathAsArray'         │ '1 323 097'  │ 755.8019793684616  │ '±0.12%' │ 661549  │
│    3    │         '(small) empty Proxy'         │ '6 154 917'  │ 162.4717045031379  │ '±0.05%' │ 3077459 │
│    4    │ '(small) native      _______________' │ '15 420 444' │  64.8489734231282  │ '±0.05%' │ 7710223 │
│    5    │         '(large) no options'          │ '1 525 779'  │ 655.4028582211741  │ '±0.55%' │ 762890  │
│    6    │          '(large) isShallow'          │ '3 202 700'  │ 312.23648588865274 │ '±0.05%' │ 1601351 │
│    7    │         '(large) pathAsArray'         │ '1 366 235'  │ 731.9384589048987  │ '±0.24%' │ 683118  │
│    8    │         '(large) empty Proxy'         │ '6 186 925'  │  161.631180983498  │ '±0.20%' │ 3093463 │
│    9    │           '(large) native '           │ '14 225 659' │ 70.29550870488931  │ '±0.06%' │ 7112830 │
└─────────┴───────────────────────────────────────┴──────────────┴────────────────────┴──────────┴─────────┘

on-change with array, read in apply

┌─────────┬───────────────────────────────────────┬──────────────┬────────────────────┬──────────┬─────────┐
│ (index) │               Task Name               │   ops/sec    │ Average Time (ns)  │  Margin  │ Samples │
├─────────┼───────────────────────────────────────┼──────────────┼────────────────────┼──────────┼─────────┤
│    0    │         '(small) no options'          │  '582 419'   │ 1716.9740900450006 │ '±0.35%' │ 291210  │
│    1    │          '(small) isShallow'          │ '1 428 949'  │ 699.8148440497139  │ '±0.13%' │ 714475  │
│    2    │         '(small) pathAsArray'         │  '542 631'   │ 1842.8715540193623 │ '±0.33%' │ 271316  │
│    3    │         '(small) empty Proxy'         │ '3 095 812'  │ 323.0169552355295  │ '±0.30%' │ 1547907 │
│    4    │ '(small) native      _______________' │ '11 323 561' │ 88.31143990498492  │ '±0.13%' │ 5661781 │
│    5    │         '(large) no options'          │   '2 913'    │  343228.749685572  │ '±5.64%' │  1458   │
│    6    │          '(large) isShallow'          │ '1 410 453'  │ 708.9915760533443  │ '±0.41%' │ 705227  │
│    7    │         '(large) pathAsArray'         │   '2 969'    │ 336772.84909719566 │ '±4.60%' │  1485   │
│    8    │         '(large) empty Proxy'         │ '3 037 917'  │ 329.1728346388685  │ '±0.30%' │ 1518959 │
│    9    │           '(large) native '           │ '11 420 999' │ 87.55801015516138  │ '±0.04%' │ 5710500 │
└─────────┴───────────────────────────────────────┴──────────────┴────────────────────┴──────────┴─────────┘

on-change with array, write in apply

┌─────────┬───────────────────────────────────────┬─────────────┬────────────────────┬──────────┬─────────┐
│ (index) │               Task Name               │   ops/sec   │ Average Time (ns)  │  Margin  │ Samples │
├─────────┼───────────────────────────────────────┼─────────────┼────────────────────┼──────────┼─────────┤
│    0    │         '(small) no options'          │  '665 335'  │ 1503.0016603857448 │ '±0.18%' │ 332668  │
│    1    │          '(small) isShallow'          │ '1 481 483' │ 674.9992321361402  │ '±0.38%' │ 740742  │
│    2    │         '(small) pathAsArray'         │  '656 236'  │ 1523.841585279125  │ '±0.24%' │ 328120  │
│    3    │         '(small) empty Proxy'         │ '1 463 482' │ 683.3017928643626  │ '±0.48%' │ 731742  │
│    4    │ '(small) native      _______________' │ '9 270 513' │ 107.86889148133523 │ '±0.72%' │ 4635257 │
│    5    │         '(large) no options'          │   '3 029'   │ 330137.6264974259  │ '±4.43%' │  1518   │
│    6    │          '(large) isShallow'          │ '1 526 567' │  655.064568739076  │ '±0.52%' │ 763284  │
│    7    │         '(large) pathAsArray'         │   '2 959'   │ 337840.4648773171  │ '±4.79%' │  1480   │
│    8    │         '(large) empty Proxy'         │ '1 548 549' │ 645.7657816970411  │ '±0.70%' │ 774275  │
│    9    │           '(large) native '           │ '9 538 016' │ 104.84360198699007 │ '±4.00%' │ 4769009 │
└─────────┴───────────────────────────────────────┴─────────────┴────────────────────┴──────────┴─────────┘

on-change with array, push

┌─────────┬───────────────────────────────────────┬──────────────┬────────────────────┬───────────┬─────────┐
│ (index) │               Task Name               │   ops/sec    │ Average Time (ns)  │  Margin   │ Samples │
├─────────┼───────────────────────────────────────┼──────────────┼────────────────────┼───────────┼─────────┤
│    0    │         '(small) no options'          │   '43 518'   │ 22978.54383911141  │ '±5.28%'  │  21762  │
│    1    │          '(small) isShallow'          │   '43 541'   │ 22966.36580302203  │ '±5.46%'  │  21845  │
│    2    │         '(small) pathAsArray'         │   '43 657'   │ 22905.573307052215 │ '±5.22%'  │  21831  │
│    3    │         '(small) empty Proxy'         │  '903 967'   │ 1106.234740358996  │ '±0.84%'  │ 451984  │
│    4    │ '(small) native      _______________' │ '12 967 624' │ 77.11512633919203  │ '±5.78%'  │ 6483813 │
│    5    │         '(large) no options'          │   '2 959'    │ 337914.4067246769  │ '±5.54%'  │  1480   │
│    6    │          '(large) isShallow'          │   '2 998'    │ 333483.59797894955 │ '±4.59%'  │  1500   │
│    7    │         '(large) pathAsArray'         │   '2 884'    │ 346635.89935318957 │ '±11.53%' │  1470   │
│    8    │         '(large) empty Proxy'         │  '880 969'   │ 1135.1131625777198 │ '±0.91%'  │ 440485  │
│    9    │           '(large) native '           │ '13 147 195' │ 76.06185109621664  │ '±5.90%'  │ 6573598 │
└─────────┴───────────────────────────────────────┴──────────────┴────────────────────┴───────────┴─────────┘

on-change with array, pop

┌─────────┬───────────────────────────────────────┬──────────────┬────────────────────┬──────────┬─────────┐
│ (index) │               Task Name               │   ops/sec    │ Average Time (ns)  │  Margin  │ Samples │
├─────────┼───────────────────────────────────────┼──────────────┼────────────────────┼──────────┼─────────┤
│    0    │         '(small) no options'          │  '989 251'   │ 1010.8653574473756 │ '±0.28%' │ 494626  │
│    1    │          '(small) isShallow'          │  '946 991'   │ 1055.975808823114  │ '±0.23%' │ 473496  │
│    2    │         '(small) pathAsArray'         │  '967 211'   │ 1033.899748898906  │ '±0.10%' │ 483606  │
│    3    │         '(small) empty Proxy'         │ '1 711 565'  │ 584.2605445364956  │ '±0.09%' │ 855783  │
│    4    │ '(small) native      _______________' │ '15 614 816' │ 64.04174077757224  │ '±0.04%' │ 7807409 │
│    5    │         '(large) no options'          │   '2 953'    │ 338564.2543762761  │ '±4.94%' │  1478   │
│    6    │          '(large) isShallow'          │   '2 914'    │ 343103.5919199264  │ '±9.89%' │  1458   │
│    7    │         '(large) pathAsArray'         │   '2 982'    │ 335256.8391086309  │ '±4.43%' │  1492   │
│    8    │         '(large) empty Proxy'         │ '1 669 104'  │ 599.1235722510621  │ '±0.06%' │ 834553  │
│    9    │           '(large) native '           │ '15 880 653' │ 62.969699533237375 │ '±0.03%' │ 7940328 │
└─────────┴───────────────────────────────────────┴──────────────┴────────────────────┴──────────┴─────────┘

on-change with array, unshift

┌─────────┬───────────────────────────────────────┬───────────┬────────────────────┬──────────┬─────────┐
│ (index) │               Task Name               │  ops/sec  │ Average Time (ns)  │  Margin  │ Samples │
├─────────┼───────────────────────────────────────┼───────────┼────────────────────┼──────────┼─────────┤
│    0    │         '(small) no options'          │ '42 088'  │ 23759.567239707663 │ '±4.99%' │  21081  │
│    1    │          '(small) isShallow'          │ '42 020'  │ 23798.118739562808 │ '±4.97%' │  21012  │
│    2    │         '(small) pathAsArray'         │ '42 104'  │ 23750.52380759284  │ '±4.93%' │  21055  │
│    3    │         '(small) empty Proxy'         │  '3 041'  │ 328739.4158737966  │ '±2.98%' │  1522   │
│    4    │ '(small) native      _______________' │ '146 351' │ 6832.8699451463235 │ '±0.74%' │  73176  │
│    5    │         '(large) no options'          │  '2 505'  │ 399186.77573941846 │ '±4.34%' │  1253   │
│    6    │          '(large) isShallow'          │  '2 625'  │  380839.571966779  │ '±4.10%' │  1313   │
│    7    │         '(large) pathAsArray'         │  '2 473'  │ 404306.52553467086 │ '±4.41%' │  1237   │
│    8    │         '(large) empty Proxy'         │   '21'    │ 45737006.18202036  │ '±3.85%' │   11    │
│    9    │           '(large) native '           │ '27 575'  │ 36264.47110699253  │ '±1.10%' │  13789  │
└─────────┴───────────────────────────────────────┴───────────┴────────────────────┴──────────┴─────────┘

on-change with array, shift

┌─────────┬───────────────────────────────────────┬──────────────┬────────────────────┬──────────┬─────────┐
│ (index) │               Task Name               │   ops/sec    │ Average Time (ns)  │  Margin  │ Samples │
├─────────┼───────────────────────────────────────┼──────────────┼────────────────────┼──────────┼─────────┤
│    0    │         '(small) no options'          │ '1 025 613'  │  975.026451765409  │ '±0.48%' │ 512807  │
│    1    │          '(small) isShallow'          │ '1 000 747'  │ 999.2528386832191  │ '±0.25%' │ 500374  │
│    2    │         '(small) pathAsArray'         │  '970 322'   │ 1030.5853748358659 │ '±0.16%' │ 485162  │
│    3    │         '(small) empty Proxy'         │ '1 850 377'  │  540.430229692676  │ '±0.06%' │ 925189  │
│    4    │ '(small) native      _______________' │ '14 408 598' │ 69.40300298852304  │ '±0.04%' │ 7204300 │
│    5    │         '(large) no options'          │   '2 515'    │ 397599.03254553035 │ '±4.34%' │  1258   │
│    6    │          '(large) isShallow'          │   '2 524'    │  396143.687981891  │ '±4.20%' │  1263   │
│    7    │         '(large) pathAsArray'         │   '2 438'    │ 410031.5286365689  │ '±4.30%' │  1220   │
│    8    │         '(large) empty Proxy'         │     '21'     │ 47502083.81834355  │ '±0.67%' │   11    │
│    9    │           '(large) native '           │   '28 326'   │ 35303.11047903556  │ '±1.12%' │  14164  │
└─────────┴───────────────────────────────────────┴──────────────┴────────────────────┴──────────┴─────────┘

on-change with array, toString

┌─────────┬───────────────────────────────────────┬─────────────┬────────────────────┬───────────┬─────────┐
│ (index) │               Task Name               │   ops/sec   │ Average Time (ns)  │  Margin   │ Samples │
├─────────┼───────────────────────────────────────┼─────────────┼────────────────────┼───────────┼─────────┤
│    0    │         '(small) no options'          │  '598 417'  │ 1671.0750604984314 │ '±0.68%'  │ 299209  │
│    1    │          '(small) isShallow'          │  '590 405'  │ 1693.750236748111  │ '±0.67%'  │ 295203  │
│    2    │         '(small) pathAsArray'         │  '603 273'  │ 1657.621742191785  │ '±0.80%'  │ 301637  │
│    3    │         '(small) empty Proxy'         │  '950 199'  │ 1052.4101710051668 │ '±0.21%'  │ 475100  │
│    4    │ '(small) native      _______________' │ '1 659 050' │ 602.7544272665052  │ '±0.86%'  │ 829526  │
│    5    │         '(large) no options'          │    '155'    │ 6435361.050976774  │ '±2.41%'  │   78    │
│    6    │          '(large) isShallow'          │    '153'    │  6507345.16866989  │ '±2.73%'  │   77    │
│    7    │         '(large) pathAsArray'         │    '152'    │ 6567766.311832449  │ '±2.71%'  │   77    │
│    8    │         '(large) empty Proxy'         │    '86'     │ 11559910.63631055  │ '±2.37%'  │   44    │
│    9    │           '(large) native '           │    '142'    │ 6996861.359247794  │ '±22.08%' │   78    │
└─────────┴───────────────────────────────────────┴─────────────┴────────────────────┴───────────┴─────────┘

Cache init

┌─────────┬────────────┬──────────────┬───────────────────┬──────────┬─────────┐
│ (index) │ Task Name  │   ops/sec    │ Average Time (ns) │  Margin  │ Samples │
├─────────┼────────────┼──────────────┼───────────────────┼──────────┼─────────┤
│    0    │   'init'   │ '10 664 897' │ 93.76555196444666 │ '±1.07%' │ 5332997 │
│    1    │ 'getProxy' │ '6 338 379'  │ 157.769037428055  │ '±0.75%' │ 3169190 │
└─────────┴────────────┴──────────────┴───────────────────┴──────────┴─────────┘

isBuiltinWithMutableMethods

┌─────────┬────────────┬──────────────┬───────────────────┬──────────┬──────────┐
│ (index) │ Task Name  │   ops/sec    │ Average Time (ns) │  Margin  │ Samples  │
├─────────┼────────────┼──────────────┼───────────────────┼──────────┼──────────┤
│    0    │   'date'   │ '20 646 747' │ 48.43377809555574 │ '±0.14%' │ 10323374 │
│    1    │ 'not date' │ '20 215 812' │ 49.46622935663465 │ '±0.09%' │ 10107907 │
└─────────┴────────────┴──────────────┴───────────────────┴──────────┴──────────┘

isBuiltinWithoutMutableMethods

┌─────────┬───────────────────┬──────────────┬────────────────────┬──────────┬──────────┐
│ (index) │     Task Name     │   ops/sec    │ Average Time (ns)  │  Margin  │ Samples  │
├─────────┼───────────────────┼──────────────┼────────────────────┼──────────┼──────────┤
│    0    │       'NaN'       │ '20 224 328' │ 49.445399398467046 │ '±0.11%' │ 10112165 │
│    1    │     'regexp'      │ '20 717 806' │ 48.267658355428374 │ '±0.11%' │ 10358904 │
│    2    │     'string'      │ '21 200 810' │ 47.16800885598961  │ '±0.08%' │ 10600406 │
│    3    │     'number'      │ '21 272 016' │ 47.01011722353314  │ '±0.04%' │ 10636009 │
│    4    │ 'number instance' │ '20 876 220' │ 47.90139040558164  │ '±0.04%' │ 10438111 │
└─────────┴───────────────────┴──────────────┴────────────────────┴──────────┴──────────┘

path.after

┌─────────┬────────────────┬──────────────┬───────────────────┬──────────┬──────────┐
│ (index) │   Task Name    │   ops/sec    │ Average Time (ns) │  Margin  │ Samples  │
├─────────┼────────────────┼──────────────┼───────────────────┼──────────┼──────────┤
│    0    │ 'string empty' │ '20 699 078' │ 48.31132884236378 │ '±0.06%' │ 10349541 │
│    1    │    'string'    │ '19 395 040' │ 51.55957235024297 │ '±0.10%' │ 9697521  │
│    2    │ 'array empty'  │ '14 671 842' │ 68.15776475188844 │ '±0.04%' │ 7335922  │
│    3    │    'array'     │ '13 595 851' │ 73.55184533666036 │ '±0.03%' │ 6797926  │
└─────────┴────────────────┴──────────────┴───────────────────┴──────────┴──────────┘

path.concat

┌─────────┬───────────────────┬──────────────┬───────────────────┬──────────┬─────────┐
│ (index) │     Task Name     │   ops/sec    │ Average Time (ns) │  Margin  │ Samples │
├─────────┼───────────────────┼──────────────┼───────────────────┼──────────┼─────────┤
│    0    │  'string empty'   │ '19 711 388' │ 50.73209298297474 │ '±0.06%' │ 9855695 │
│    1    │     'string'      │ '13 719 255' │ 72.89025084037512 │ '±1.34%' │ 6859628 │
│    2    │ 'string + Symbol' │ '8 444 471'  │ 118.4206771732699 │ '±4.83%' │ 4222236 │
│    3    │   'array empty'   │ '14 920 962' │  67.019804754326  │ '±0.05%' │ 7460482 │
│    4    │      'array'      │ '13 088 319' │ 76.4040048803305  │ '±0.05%' │ 6544160 │
│    5    │ 'array + Symbol'  │ '13 128 106' │ 76.17244534807662 │ '±0.13%' │ 6564054 │
└─────────┴───────────────────┴──────────────┴───────────────────┴──────────┴─────────┘

path.initial

┌─────────┬────────────────┬──────────────┬───────────────────┬──────────┬─────────┐
│ (index) │   Task Name    │   ops/sec    │ Average Time (ns) │  Margin  │ Samples │
├─────────┼────────────────┼──────────────┼───────────────────┼──────────┼─────────┤
│    0    │ 'string empty' │ '18 849 894' │ 53.05069480941036 │ '±0.05%' │ 9424948 │
│    1    │    'string'    │ '12 397 794' │ 80.65950463840858 │ '±0.10%' │ 6198898 │
│    2    │ 'array empty'  │ '13 862 337' │ 72.1379072920577  │ '±0.04%' │ 6931169 │
│    3    │    'array'     │ '13 690 082' │ 73.04558052012872 │ '±0.15%' │ 6845042 │
└─────────┴────────────────┴──────────────┴───────────────────┴──────────┴─────────┘

path.walk

┌─────────┬─────────────────────┬──────────────┬────────────────────┬──────────┬──────────┐
│ (index) │      Task Name      │   ops/sec    │ Average Time (ns)  │  Margin  │ Samples  │
├─────────┼─────────────────────┼──────────────┼────────────────────┼──────────┼──────────┤
│    0    │   'string empty'    │ '20 795 352' │ 48.08766773885601  │ '±0.07%' │ 10397677 │
│    1    │ 'string single key' │ '16 560 227' │ 60.38564304617406  │ '±0.09%' │ 8280114  │
│    2    │ 'string three key'  │ '10 797 027' │ 92.61808432215102  │ '±0.08%' │ 5398514  │
│    3    │    'array empty'    │ '19 347 952' │ 51.685056404558836 │ '±0.13%' │ 9673977  │
│    4    │ 'array single key'  │ '15 420 495' │ 64.84875954853207  │ '±0.20%' │ 7710248  │
│    5    │  'array three key'  │ '16 989 385' │ 58.860281671682365 │ '±0.04%' │ 8494693  │
└─────────┴─────────────────────┴──────────────┴────────────────────┴──────────┴──────────┘

SmartClone

┌─────────┬──────────────────┬──────────────┬────────────────────┬──────────┬─────────┐
│ (index) │    Task Name     │   ops/sec    │ Average Time (ns)  │  Margin  │ Samples │
├─────────┼──────────────────┼──────────────┼────────────────────┼──────────┼─────────┤
│    0    │      'init'      │ '18 362 604' │ 54.458504984839024 │ '±0.14%' │ 9181303 │
│    1    │ 'init and start' │ '8 299 953'  │ 120.48260301213041 │ '±0.91%' │ 4149977 │
│    2    │  'start, path'   │ '4 716 713'  │ 212.0120381124675  │ '±0.19%' │ 2358357 │
│    3    │ 'start, no path' │ '7 855 942'  │ 127.29217029316045 │ '±1.33%' │ 3927972 │
│    4    │ 'update, object' │ '3 920 320'  │ 255.0812112235112  │ '±0.54%' │ 1960161 │
│    5    │ 'update, array'  │ '3 682 956'  │ 271.52099173321994 │ '±0.40%' │ 1841479 │
└─────────┴──────────────────┴──────────────┴────────────────────┴──────────┴─────────┘

@sindresorhus sindresorhus merged commit a9cc1e2 into sindresorhus:main May 18, 2024
2 checks passed
@sindresorhus
Copy link
Owner

Thanks for doing this 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants