RESULTS-v20.md
October 17, 2025 ยท View on GitHub
Adding property
| name | ops/sec | samples |
|---|---|---|
| Directly in the object | 81,417,988 | 40709516 |
| Using dot notation | 76,899,991 | 38461944 |
| Using define property (writable) | 4,556,645 | 2279209 |
| Using define property initialized (writable) | 6,029,020 | 3014611 |
| Using define property (getter) | 2,162,023 | 1081012 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 15:42:02 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Array.append (number)
| type | amount | time elapsed |
|---|---|---|
| array.push | 10 | 0.004ms |
| new Array(length) | 10 | 0.002ms |
| array.push | 100 | 0.112ms |
| new Array(length) | 100 | 0.009ms |
| array.push | 1,000 | 0.03ms |
| new Array(length) | 1,000 | 0.015ms |
| array.push | 10,000 | 0.266ms |
| new Array(length) | 10,000 | 0.301ms |
| array.push | 1,000,000 | 33.188ms |
| new Array(length) | 1,000,000 | 7.663ms |
| array.push | 10,000,000 | 235.34ms |
| new Array(length) | 10,000,000 | 67.158ms |
Array.append (string)
| type | amount | time elapsed |
|---|---|---|
| array.push | 10 | 0.004ms |
| new Array(length) | 10 | 0.004ms |
| array.push | 100 | 0.013ms |
| new Array(length) | 100 | 0.011ms |
| array.push | 1,000 | 0.041ms |
| new Array(length) | 1,000 | 0.021ms |
| array.push | 10,000 | 0.236ms |
| new Array(length) | 10,000 | 0.24ms |
| array.push | 1,000,000 | 26.072ms |
| new Array(length) | 1,000,000 | 8.288ms |
| array.push | 10,000,000 | 211.079ms |
| new Array(length) | 10,000,000 | 66.028ms |
Array Creation
| name | ops/sec | samples |
|---|---|---|
| new Array | 250 | 126 |
| Array.from | 22 | 12 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 15:47:39 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Blob
| name | ops/sec | samples |
|---|---|---|
| new Blob (128) | 4,023 | 2050 |
| new Blob (1024) | 507 | 254 |
| text (128) | 4,488 | 2245 |
| text (1024) | 567 | 284 |
| arrayBuffer (128) | 4,486 | 2249 |
| arrayBuffer (1024) | 557 | 281 |
| slice (0, 64) | 61,647 | 30824 |
| slice (0, 512) | 24,985 | 12498 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 15:49:08 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Compression algorithms
| name | total time | samples |
|---|---|---|
| Deflate | 133.43 ms | 1 |
| Gzip | 134.28 ms | 1 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 15:54:53 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Crypto Verify
| name | ops/sec | samples |
|---|---|---|
| crypto.createVerify('RSA-SHA256') | 6,026 | 3014 |
| crypto.verify('RSA-SHA256') | 6,663 | 3347 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 15:59:34 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Date toISOString
| name | ops/sec | samples |
|---|---|---|
| new Date().toISOString() | 1,407,893 | 704024 |
| fromUnixToISOString(new Date()) | 2,100,419 | 1050210 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 16:02:04 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Date format MM/DD/YYYY
| name | ops/sec | samples |
|---|---|---|
| Intl.DateTimeFormat().format(Date.now()) | 19,585 | 9822 |
| Intl.DateTimeFormat().format(new Date()) | 19,228 | 9615 |
| Intl.DateTimeFormat(undefined, twoDigitsLocaleOptions).format(Date.now()) | 19,931 | 9980 |
| Intl.DateTimeFormat(undefined, twoDigitsLocaleOptions).format(new Date()) | 18,895 | 9448 |
| Reusing Intl.DateTimeFormat() | 424,291 | 212148 |
| Date.toLocaleDateString() | 964,520 | 482382 |
| Date.toLocaleDateString(undefined, twoDigitsLocaleOptions) | 23,454 | 11728 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 16:06:31 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Date String coersion
| name | ops/sec | samples |
|---|---|---|
| Using String() | 1,090,408 | 545224 |
| Using brackets {} | 1,056,805 | 528403 |
| Using '' + | 1,004,508 | 502356 |
| Using date.toString() | 1,187,910 | 593956 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 16:09:43 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Deleting properties
| name | ops/sec | samples |
|---|---|---|
| Using delete property | 3,734,726 | 1867732 |
| Using delete property (proto: null) | 17,362,093 | 8681053 |
| Using delete property (cached proto: null) | 3,767,456 | 1883987 |
| Using undefined assignment | 85,936,507 | 42972401 |
| Using undefined assignment (proto: null) | 18,490,556 | 9249688 |
| Using undefined property (cached proto: null) | 86,230,209 | 43115112 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 16:12:16 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Node.js Error
| name | ops/sec | samples |
|---|---|---|
| Error | 304,696 | 152349 |
| NodeError | 286,150 | 144034 |
| NodeError Range | 267,201 | 133601 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 16:17:18 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Array.includes vs raw comparison
| name | ops/sec | samples |
|---|---|---|
| using Array.includes | 72,406,137 | 36207588 |
| using Array.includes (first item) | 85,571,666 | 42795786 |
| Using raw comparison | 100,052,777 | 50038639 |
| Using raw comparison (first item) | 97,540,163 | 48778855 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 16:20:31 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Object.keys vs Object.getOwnPropertyNames comparison
| name | ops/sec | samples |
|---|---|---|
| Using Object.keys() | 43,498,511 | 21749256 |
| Using Object.getOwnPropertyNames() | 47,956,380 | 23978852 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 16:22:49 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Get the last item of an Array
| name | ops/sec | samples |
|---|---|---|
| Length = 100 - Array.at | 99,451,064 | 49737463 |
| Length = 10_000 - Array.at | 90,292,744 | 45146380 |
| Length = 1_000_000 - Array.at | 97,429,208 | 48714614 |
| Length = 100 - Array[length - 1] | 98,159,324 | 49080886 |
| Length = 10_000 - Array[length - 1] | 98,676,993 | 49338517 |
| Length = 1_000_000 - Array[length - 1] | 99,648,391 | 49829656 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 16:26:17 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Math.floor vs ~
| name | ops/sec | samples |
|---|---|---|
| Math.floor (small) | 99,299,250 | 49698868 |
| ~ (small) | 101,898,955 | 50949483 |
| Math.floor (long) | 102,297,184 | 51148594 |
| ~ (long) | 101,941,405 | 50970705 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 16:29:59 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Object Creation
| name | ops/sec | samples |
|---|---|---|
| Object.create(null) | 36,691,195 | 18478586 |
| Object.create({}) | 1,931,102 | 965564 |
| new Function with empty prototype | 71,160,287 | 35580556 |
| Empty class | 79,174,296 | 39591942 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 16:31:34 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Parsing Integer
| name | ops/sec | samples |
|---|---|---|
| Using parseInt(x, 10) - small number (2 len) | 100,671,553 | 50339367 |
| Using parseInt(x, 10) - big number (10 len) | 101,338,821 | 50670540 |
| Using + - small number (2 len) | 97,698,289 | 48852125 |
| Using + - big number (10 len) | 103,049,279 | 51524654 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 16:35:00 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Possible undefined Function
| name | ops/sec | samples |
|---|---|---|
| Using if to check function existence | 734,964 | 368458 |
| Using ? operator to avoid rejection | 831,142 | 415572 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 16:39:09 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Private Property
| name | ops/sec | samples |
|---|---|---|
| Raw usage private field | 100,626,942 | 50314198 |
| Raw usage underscore usage | 101,013,962 | 50522941 |
| Manipulating private properties using # | 101,352,142 | 50676219 |
| Manipulating private properties using underscore(_) | 101,706,604 | 50853330 |
| Manipulating private properties using Symbol | 102,464,409 | 51233400 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 16:40:14 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Property access after shape transition
| name | ops/sec | samples |
|---|---|---|
| Adding property after object creation - small object | 7,598,448 | 3799478 |
| Adding property in the object creation - small object | 7,628,476 | 3814565 |
| Adding property after the function creation - small class | 234,888 | 118570 |
| Adding property in the function creation - small class | 244,555 | 122963 |
| Adding property after the class creation - small class | 236,662 | 118775 |
| Adding property in the class creation - small class | 230,108 | 115055 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 16:44:35 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Property Getter Access
| name | ops/sec | samples |
|---|---|---|
| Getter (class) | 99,423,759 | 49713915 |
| Getter | 54,024,166 | 27012089 |
| Method | 101,270,023 | 50635018 |
| DefineProperty (getter) | 94,354,259 | 47177148 |
| DefineProperty (getter & enumerable=false) | 53,662,823 | 26831415 |
| DefineProperty (getter & configurable=false) | 101,332,595 | 50674984 |
| DefineProperty (getter & enumerable=false & configurable=false) | 53,772,816 | 26890609 |
| DefineProperty (writable) | 100,879,487 | 50473134 |
| DefineProperty (writable & enumerable=false) | 100,534,194 | 50269084 |
| DefineProperty (writable & enumerable=false & configurable=false) | 97,905,647 | 48979962 |
| DefineProperties (getter) | 52,938,683 | 26471255 |
| DefineProperties (getter & enumerable=false) | 53,774,836 | 26887430 |
| DefineProperties (getter & enumerable=false & configurable=false) | 53,711,385 | 26855695 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 16:48:18 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Property Setter Access
| name | ops/sec | samples |
|---|---|---|
| Setter (class) | 102,069,690 | 51035268 |
| Setter | 11,434,241 | 5717124 |
| Method | 99,749,157 | 49874585 |
| DefineProperty (setter) | 100,287,692 | 50143854 |
| DefineProperty (setter & enumerable=false) | 11,697,694 | 5850014 |
| DefineProperty (setter & configurable=false) | 11,549,489 | 5775576 |
| DefineProperty (setter & enumerable=false & configurable=false) | 11,526,749 | 5763375 |
| DefineProperty (writable) | 101,629,045 | 50814546 |
| DefineProperty (writable & enumerable=false) | 105,027,175 | 52513598 |
| DefineProperty (writable & enumerable=false & configurable=false) | 103,265,573 | 51649470 |
| DefineProperties (setter) | 97,049,768 | 48541740 |
| DefineProperties (setter & enumerable=false) | 11,567,429 | 5783716 |
| DefineProperties (setter & enumerable=false & configurable=false) | 11,721,493 | 5860757 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 16:50:03 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
replace vs replaceAll comparison
| name | ops/sec | samples |
|---|---|---|
| Using replace(//g) | 3,525,242 | 1762914 |
| Using replaceAll() | 3,019,715 | 1510013 |
| Using replaceAll(//g) | 3,170,963 | 1585718 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 16:53:28 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Shallow Copy
| name | ops/sec | samples |
|---|---|---|
| { ...object } | 22,099,895 | 11050181 |
| { ...object, proto: null } | 22,147,303 | 11073980 |
| { ...object, newProp: true } | 849,651 | 424827 |
| structuredClone | 293,455 | 146798 |
| JSON.parse + JSON.stringify | 193,359 | 96680 |
| loop + object.keys starting with {} | 1,516,501 | 758488 |
| loop + object.keys starting with { proto: null } | 784,118 | 392061 |
| loop + object.keys starting with { randomProp: true } | 532,585 | 266317 |
| object.keys + reduce(FN, {}) | 1,540,095 | 770072 |
| object.keys + reduce(FN, { proto: null }) | 803,066 | 401662 |
| object.keys + reduce(FN, { newProp: true }) | 523,614 | 261808 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 16:56:53 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Sorting Map
| name | ops/sec | samples |
|---|---|---|
| Sort using default | 271,300 | 135843 |
| Sort using first char | 1,372,589 | 686310 |
| Sort using localeCompare | 1,270,980 | 635621 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 17:01:57 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Object.assign VS spread operator
| name | ops/sec | samples |
|---|---|---|
| {...bigObject} - Total keys: 1000 | 1,762 | 882 |
| {...smallObject} - Total keys: 2 | 40,177,326 | 20110526 |
| Object.assign({}, bigObject, anotherBigObject) - Total keys: 1000 - creating new object | 1,064 | 533 |
| Object.assign(bigObject, anotherBigObject) - mutating bigObject | 6,664 | 3333 |
| { ...bigObject, ...anotherBigObject } | 1,115 | 559 |
| Object.assign({}, smallObject, anotherSmallObject) - creating new object | 12,192,165 | 6096487 |
| Object.assign(smallObject, anotherSmallObject) - mutating smallObject | 28,954,585 | 14477300 |
| { ...smallObject, ...anotherSmallObject } | 20,610,268 | 10305401 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 17:05:30 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Stream.Readable
| name | ops/sec | samples |
|---|---|---|
| streams.Readable reading 1e3 * "some data" | 2,016 | 1009 |
| streams.web.Readable reading 1e3 * "some data" | 1,484 | 743 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 17:09:10 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Stream.Writable
| name | ops/sec | samples |
|---|---|---|
| streams.Writable writing 1e3 * "some data" | 8,122 | 4062 |
| streams.web.WritableStream writing 1e3 * "some data" | 1,407 | 704 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 17:10:13 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
String concat
| name | ops/sec | samples |
|---|---|---|
| Using + sign | 100,144,041 | 50072033 |
| Using backtick (`) | 97,570,710 | 48815233 |
| Using array.join | 10,991,838 | 5497655 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 17:14:51 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
endsWith comparison
| name | ops/sec | samples |
|---|---|---|
| (short string) (true) String#endsWith | 54,067,532 | 27034262 |
| (short string) (true) String#slice and strict comparison | 65,051,248 | 32525908 |
| (long string) (true) String#endsWith | 50,651,401 | 25364735 |
| (long string) (true) String#slice and strict comparison | 59,335,702 | 29670920 |
| (short string) (false) String#endsWith | 59,226,979 | 29613506 |
| (short string) (false) String#slice and strict comparison | 63,804,465 | 31904716 |
| (long string) (false) String#endsWith | 55,235,773 | 27617904 |
| (long string) (false) String#slice and strict comparison | 58,466,096 | 29233833 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 17:17:36 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
String searching
| name | ops/sec | samples |
|---|---|---|
| Using includes | 16,220,057 | 8116578 |
| Using indexof | 16,161,866 | 8080936 |
| Using RegExp.test | 13,570,906 | 6786147 |
| Using RegExp.text with cached regex pattern | 14,231,638 | 7115821 |
| Using new RegExp.test | 4,383,834 | 2191919 |
| Using new RegExp.test with cached regex pattern | 4,987,919 | 2494535 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 17:21:39 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
startsWith comparison
| name | ops/sec | samples |
|---|---|---|
| (short string) (true) String#startsWith | 83,015,172 | 41507594 |
| (short string) (true) String#slice and strict comparison | 64,776,618 | 32395836 |
| (long string) (true) String#startsWith | 65,506,881 | 32753554 |
| (long string) (true) String#slice and strict comparison | 59,135,717 | 29596858 |
| (short string) (false) String#startsWith | 100,348,023 | 50174018 |
| (short string) (false) String#slice and strict comparison | 63,775,932 | 31887971 |
| (long string) (false) String#startsWith | 92,647,507 | 46323904 |
| (long string) (false) String#slice and strict comparison | 58,624,930 | 29320594 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 17:26:01 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Super vs This
| name | ops/sec | samples |
|---|---|---|
| Using super | 93,301,927 | 46651565 |
| Using this | 100,462,511 | 50231276 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 17:27:02 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5
Getting unix time
| name | ops/sec | samples |
|---|---|---|
| new Date().getTime() | 11,114,460 | 5557611 |
| Date.now() | 20,674,593 | 10337397 |
Environment
- Machine: linux x64 | 4 vCPUs | 7.6GB Mem
- Run: Fri Oct 17 2025 17:31:13 GMT+0000 (Coordinated Universal Time)
- Node:
v20.19.5