RESULTS-v22.md
October 15, 2025 ยท View on GitHub
Adding property
| name | ops/sec | samples |
|---|---|---|
| Directly in the object | 107,861,524 | 53993303 |
| Using dot notation | 79,568,169 | 39784201 |
| Using define property (writable) | 4,871,497 | 2435750 |
| Using define property initialized (writable) | 6,953,717 | 3476868 |
| Using define property (getter) | 2,470,401 | 1237214 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 20:50:54 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Array.append (number)
| type | amount | time elapsed |
|---|---|---|
| array.push | 10 | 0.004ms |
| new Array(length) | 10 | 0.001ms |
| array.push | 100 | 0.021ms |
| new Array(length) | 100 | 0.009ms |
| array.push | 1,000 | 0.034ms |
| new Array(length) | 1,000 | 0.041ms |
| array.push | 10,000 | 0.252ms |
| new Array(length) | 10,000 | 0.139ms |
| array.push | 1,000,000 | 31.367ms |
| new Array(length) | 1,000,000 | 7.662ms |
| array.push | 10,000,000 | 256.697ms |
| new Array(length) | 10,000,000 | 67.059ms |
Array.append (string)
| type | amount | time elapsed |
|---|---|---|
| array.push | 10 | 0.004ms |
| new Array(length) | 10 | 0.003ms |
| array.push | 100 | 0.014ms |
| new Array(length) | 100 | 0.012ms |
| array.push | 1,000 | 0.035ms |
| new Array(length) | 1,000 | 0.019ms |
| array.push | 10,000 | 0.295ms |
| new Array(length) | 10,000 | 0.196ms |
| array.push | 1,000,000 | 23.077ms |
| new Array(length) | 1,000,000 | 12.069ms |
| array.push | 10,000,000 | 224.307ms |
| new Array(length) | 10,000,000 | 67.689ms |
Array Creation
| name | ops/sec | samples |
|---|---|---|
| new Array | 299 | 151 |
| Array.from | 24 | 13 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 20:57:55 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Blob
| name | ops/sec | samples |
|---|---|---|
| new Blob (128) | 4,487 | 2245 |
| new Blob (1024) | 581 | 295 |
| text (128) | 4,153 | 2077 |
| text (1024) | 526 | 264 |
| arrayBuffer (128) | 4,146 | 2077 |
| arrayBuffer (1024) | 524 | 263 |
| slice (0, 64) | 251,409 | 136866 |
| slice (0, 512) | 34,988 | 24497 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 21:04:08 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Compression algorithms
| name | total time | samples |
|---|---|---|
| Deflate | 132.32 ms | 1 |
| Gzip | 133.51 ms | 1 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 21:07:14 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Crypto Verify
| name | ops/sec | samples |
|---|---|---|
| crypto.createVerify('RSA-SHA256') | 21,776 | 10889 |
| crypto.verify('RSA-SHA256') | 21,149 | 10622 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 21:15:00 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Date toISOString
| name | ops/sec | samples |
|---|---|---|
| new Date().toISOString() | 1,517,437 | 758923 |
| fromUnixToISOString(new Date()) | 2,138,746 | 1069548 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 21:20:02 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Date format MM/DD/YYYY
| name | ops/sec | samples |
|---|---|---|
| Intl.DateTimeFormat().format(Date.now()) | 20,915 | 10458 |
| Intl.DateTimeFormat().format(new Date()) | 19,893 | 9947 |
| Intl.DateTimeFormat(undefined, twoDigitsLocaleOptions).format(Date.now()) | 20,051 | 10026 |
| Intl.DateTimeFormat(undefined, twoDigitsLocaleOptions).format(new Date()) | 19,015 | 9511 |
| Reusing Intl.DateTimeFormat() | 443,872 | 222456 |
| Date.toLocaleDateString() | 963,252 | 481650 |
| Date.toLocaleDateString(undefined, twoDigitsLocaleOptions) | 24,967 | 12484 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 21:23:48 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Date String coersion
| name | ops/sec | samples |
|---|---|---|
| Using String() | 1,018,299 | 509150 |
| Using brackets {} | 1,050,992 | 525632 |
| Using '' + | 1,118,375 | 559241 |
| Using date.toString() | 1,222,561 | 611281 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 21:27:09 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Deleting properties
| name | ops/sec | samples |
|---|---|---|
| Using delete property | 4,074,312 | 2037809 |
| Using delete property (proto: null) | 18,129,523 | 9065350 |
| Using delete property (cached proto: null) | 4,124,346 | 2062585 |
| Using undefined assignment | 80,290,402 | 40146936 |
| Using undefined assignment (proto: null) | 19,629,782 | 9814894 |
| Using undefined property (cached proto: null) | 77,115,188 | 38557599 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 21:31:12 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Node.js Error
| name | ops/sec | samples |
|---|---|---|
| Error | 339,539 | 169770 |
| NodeError | 316,964 | 158635 |
| NodeError Range | 296,021 | 148298 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 21:34:10 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Array.includes vs raw comparison
| name | ops/sec | samples |
|---|---|---|
| using Array.includes | 74,168,766 | 37105533 |
| using Array.includes (first item) | 83,211,763 | 41607427 |
| Using raw comparison | 97,231,204 | 48615606 |
| Using raw comparison (first item) | 98,367,872 | 49193854 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 21:39:20 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Object.keys vs Object.getOwnPropertyNames comparison
| name | ops/sec | samples |
|---|---|---|
| Using Object.keys() | 41,359,588 | 20682202 |
| Using Object.getOwnPropertyNames() | 40,697,881 | 20349995 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 21:42:59 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Get the last item of an Array
| name | ops/sec | samples |
|---|---|---|
| Length = 100 - Array.at | 86,543,397 | 43432706 |
| Length = 10_000 - Array.at | 83,846,125 | 41951136 |
| Length = 1_000_000 - Array.at | 90,440,939 | 45222897 |
| Length = 100 - Array[length - 1] | 81,103,455 | 40555299 |
| Length = 10_000 - Array[length - 1] | 82,472,493 | 41237383 |
| Length = 1_000_000 - Array[length - 1] | 88,106,628 | 44053838 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 21:48:24 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Math.floor vs ~
| name | ops/sec | samples |
|---|---|---|
| Math.floor (small) | 96,310,801 | 48155421 |
| ~ (small) | 97,835,516 | 48929989 |
| Math.floor (long) | 97,843,478 | 48925594 |
| ~ (long) | 98,508,969 | 49255741 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 21:52:45 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Object Creation
| name | ops/sec | samples |
|---|---|---|
| Object.create(null) | 36,811,394 | 18437205 |
| Object.create({}) | 2,152,923 | 1076560 |
| new Function with empty prototype | 104,020,777 | 52011549 |
| Empty class | 72,473,083 | 36239929 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 21:55:40 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Parsing Integer
| name | ops/sec | samples |
|---|---|---|
| Using parseInt(x, 10) - small number (2 len) | 98,651,424 | 49325719 |
| Using parseInt(x, 10) - big number (10 len) | 98,447,911 | 49225485 |
| Using + - small number (2 len) | 98,448,163 | 49224087 |
| Using + - big number (10 len) | 98,217,362 | 49110750 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 22:00:34 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Possible undefined Function
| name | ops/sec | samples |
|---|---|---|
| Using if to check function existence | 1,178,242 | 602493 |
| Using ? operator to avoid rejection | 1,234,075 | 617061 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 22:03:28 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Private Property
| name | ops/sec | samples |
|---|---|---|
| Raw usage private field | 96,126,804 | 48063428 |
| Raw usage underscore usage | 97,220,224 | 48610981 |
| Manipulating private properties using # | 99,595,026 | 49805529 |
| Manipulating private properties using underscore(_) | 97,623,821 | 49549111 |
| Manipulating private properties using Symbol | 96,590,754 | 48295386 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 22:06:49 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Property access after shape transition
| name | ops/sec | samples |
|---|---|---|
| Adding property after object creation - small object | 8,059,698 | 4053974 |
| Adding property in the object creation - small object | 8,213,159 | 4108926 |
| Adding property after the function creation - small class | 269,563 | 134802 |
| Adding property in the function creation - small class | 281,158 | 140580 |
| Adding property after the class creation - small class | 272,781 | 137420 |
| Adding property in the class creation - small class | 274,067 | 137038 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 22:12:00 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Property Getter Access
| name | ops/sec | samples |
|---|---|---|
| Getter (class) | 95,920,532 | 47960274 |
| Getter | 50,764,603 | 25382314 |
| Method | 98,440,356 | 49221059 |
| DefineProperty (getter) | 95,944,175 | 47974174 |
| DefineProperty (getter & enumerable=false) | 50,460,102 | 25262768 |
| DefineProperty (getter & configurable=false) | 94,707,639 | 47561338 |
| DefineProperty (getter & enumerable=false & configurable=false) | 50,478,778 | 25240215 |
| DefineProperty (writable) | 96,230,090 | 48115051 |
| DefineProperty (writable & enumerable=false) | 90,421,600 | 45210807 |
| DefineProperty (writable & enumerable=false & configurable=false) | 90,960,741 | 45480385 |
| DefineProperties (getter) | 50,699,860 | 25349935 |
| DefineProperties (getter & enumerable=false) | 49,955,689 | 24977849 |
| DefineProperties (getter & enumerable=false & configurable=false) | 50,029,811 | 25038814 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 22:18:02 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Property Setter Access
| name | ops/sec | samples |
|---|---|---|
| Setter (class) | 99,000,457 | 49501792 |
| Setter | 11,825,279 | 5912753 |
| Method | 93,913,023 | 46956518 |
| DefineProperty (setter) | 99,890,796 | 49979105 |
| DefineProperty (setter & enumerable=false) | 11,759,563 | 5884050 |
| DefineProperty (setter & configurable=false) | 11,849,235 | 5924927 |
| DefineProperty (setter & enumerable=false & configurable=false) | 11,992,603 | 5996305 |
| DefineProperty (writable) | 100,264,211 | 50132111 |
| DefineProperty (writable & enumerable=false) | 100,733,651 | 50369285 |
| DefineProperty (writable & enumerable=false & configurable=false) | 101,126,299 | 50563157 |
| DefineProperties (setter) | 97,010,650 | 48506016 |
| DefineProperties (setter & enumerable=false) | 11,758,791 | 5882116 |
| DefineProperties (setter & enumerable=false & configurable=false) | 11,850,251 | 5925139 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 22:22:48 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
replace vs replaceAll comparison
| name | ops/sec | samples |
|---|---|---|
| Using replace(//g) | 3,405,288 | 1703005 |
| Using replaceAll() | 3,209,756 | 1604895 |
| Using replaceAll(//g) | 3,083,328 | 1541665 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 22:27:37 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Shallow Copy
| name | ops/sec | samples |
|---|---|---|
| { ...object } | 25,077,148 | 12576572 |
| { ...object, proto: null } | 2,659,544 | 1329773 |
| { ...object, newProp: true } | 23,140,485 | 11573129 |
| structuredClone | 293,877 | 146940 |
| JSON.parse + JSON.stringify | 310,672 | 155359 |
| loop + object.keys starting with {} | 1,720,001 | 860074 |
| loop + object.keys starting with { proto: null } | 912,203 | 456165 |
| loop + object.keys starting with { randomProp: true } | 672,151 | 336102 |
| object.keys + reduce(FN, {}) | 1,795,307 | 898042 |
| object.keys + reduce(FN, { proto: null }) | 984,592 | 492536 |
| object.keys + reduce(FN, { newProp: true }) | 698,326 | 349255 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 22:33:51 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Sorting Map
| name | ops/sec | samples |
|---|---|---|
| Sort using default | 323,314 | 161680 |
| Sort using first char | 1,381,491 | 691037 |
| Sort using localeCompare | 1,276,849 | 638506 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 22:36:03 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Object.assign VS spread operator
| name | ops/sec | samples |
|---|---|---|
| {...bigObject} - Total keys: 1000 | 1,780 | 891 |
| {...smallObject} - Total keys: 2 | 38,592,540 | 19299979 |
| Object.assign({}, bigObject, anotherBigObject) - Total keys: 1000 - creating new object | 1,064 | 533 |
| Object.assign(bigObject, anotherBigObject) - mutating bigObject | 6,822 | 3413 |
| { ...bigObject, ...anotherBigObject } | 1,116 | 559 |
| Object.assign({}, smallObject, anotherSmallObject) - creating new object | 12,239,159 | 6119857 |
| Object.assign(smallObject, anotherSmallObject) - mutating smallObject | 28,583,996 | 14292898 |
| { ...smallObject, ...anotherSmallObject } | 21,204,138 | 10602289 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 22:41:40 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Stream.Readable
| name | ops/sec | samples |
|---|---|---|
| streams.Readable reading 1e3 * "some data" | 1,959 | 980 |
| streams.web.Readable reading 1e3 * "some data" | 1,790 | 896 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 22:46:09 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Stream.Writable
| name | ops/sec | samples |
|---|---|---|
| streams.Writable writing 1e3 * "some data" | 9,272 | 4644 |
| streams.web.WritableStream writing 1e3 * "some data" | 1,758 | 880 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 22:50:27 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
String concat
| name | ops/sec | samples |
|---|---|---|
| Using + sign | 98,892,905 | 49452831 |
| Using backtick (`) | 96,660,564 | 48330466 |
| Using array.join | 9,917,722 | 4966477 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 22:52:11 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
endsWith comparison
| name | ops/sec | samples |
|---|---|---|
| (short string) (true) String#endsWith | 90,622,657 | 45313365 |
| (short string) (true) String#slice and strict comparison | 60,486,383 | 30243197 |
| (long string) (true) String#endsWith | 62,332,384 | 31172223 |
| (long string) (true) String#slice and strict comparison | 54,949,531 | 27474769 |
| (short string) (false) String#endsWith | 95,909,911 | 47955282 |
| (short string) (false) String#slice and strict comparison | 61,886,336 | 30943172 |
| (long string) (false) String#endsWith | 89,623,932 | 44811975 |
| (long string) (false) String#slice and strict comparison | 55,773,622 | 27886819 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 22:55:51 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
String searching
| name | ops/sec | samples |
|---|---|---|
| Using includes | 15,832,964 | 7916484 |
| Using indexof | 15,965,578 | 7982790 |
| Using RegExp.test | 13,458,347 | 6729286 |
| Using RegExp.text with cached regex pattern | 14,501,073 | 7254200 |
| Using new RegExp.test | 4,761,047 | 2380525 |
| Using new RegExp.test with cached regex pattern | 5,372,986 | 2686495 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 23:03:35 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
startsWith comparison
| name | ops/sec | samples |
|---|---|---|
| (short string) (true) String#startsWith | 91,825,201 | 45946693 |
| (short string) (true) String#slice and strict comparison | 60,587,981 | 30304356 |
| (long string) (true) String#startsWith | 59,914,425 | 29960859 |
| (long string) (true) String#slice and strict comparison | 54,819,244 | 27424195 |
| (short string) (false) String#startsWith | 95,973,679 | 47997323 |
| (short string) (false) String#slice and strict comparison | 61,470,937 | 30743123 |
| (long string) (false) String#startsWith | 88,951,969 | 44800061 |
| (long string) (false) String#slice and strict comparison | 55,347,970 | 27674485 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 23:08:23 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Super vs This
| name | ops/sec | samples |
|---|---|---|
| Using super | 95,194,705 | 47613722 |
| Using this | 97,845,930 | 49405515 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 23:09:43 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0
Getting unix time
| name | ops/sec | samples |
|---|---|---|
| new Date().getTime() | 10,702,994 | 5351583 |
| Date.now() | 19,809,833 | 9904918 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Wed Oct 15 2025 23:14:17 GMT+0000 (Coordinated Universal Time)
- Node:
v22.20.0