RESULTS-v22.md

October 15, 2025 ยท View on GitHub

Adding property

nameops/secsamples
Directly in the object107,861,52453993303
Using dot notation79,568,16939784201
Using define property (writable)4,871,4972435750
Using define property initialized (writable)6,953,7173476868
Using define property (getter)2,470,4011237214
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)

typeamounttime elapsed
array.push100.004ms
new Array(length)100.001ms
array.push1000.021ms
new Array(length)1000.009ms
array.push1,0000.034ms
new Array(length)1,0000.041ms
array.push10,0000.252ms
new Array(length)10,0000.139ms
array.push1,000,00031.367ms
new Array(length)1,000,0007.662ms
array.push10,000,000256.697ms
new Array(length)10,000,00067.059ms

Array.append (string)

typeamounttime elapsed
array.push100.004ms
new Array(length)100.003ms
array.push1000.014ms
new Array(length)1000.012ms
array.push1,0000.035ms
new Array(length)1,0000.019ms
array.push10,0000.295ms
new Array(length)10,0000.196ms
array.push1,000,00023.077ms
new Array(length)1,000,00012.069ms
array.push10,000,000224.307ms
new Array(length)10,000,00067.689ms

Array Creation

nameops/secsamples
new Array299151
Array.from2413
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

nameops/secsamples
new Blob (128)4,4872245
new Blob (1024)581295
text (128)4,1532077
text (1024)526264
arrayBuffer (128)4,1462077
arrayBuffer (1024)524263
slice (0, 64)251,409136866
slice (0, 512)34,98824497
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

nametotal timesamples
Deflate132.32 ms1
Gzip133.51 ms1
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

nameops/secsamples
crypto.createVerify('RSA-SHA256')21,77610889
crypto.verify('RSA-SHA256')21,14910622
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

nameops/secsamples
new Date().toISOString()1,517,437758923
fromUnixToISOString(new Date())2,138,7461069548
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

nameops/secsamples
Intl.DateTimeFormat().format(Date.now())20,91510458
Intl.DateTimeFormat().format(new Date())19,8939947
Intl.DateTimeFormat(undefined, twoDigitsLocaleOptions).format(Date.now())20,05110026
Intl.DateTimeFormat(undefined, twoDigitsLocaleOptions).format(new Date())19,0159511
Reusing Intl.DateTimeFormat()443,872222456
Date.toLocaleDateString()963,252481650
Date.toLocaleDateString(undefined, twoDigitsLocaleOptions)24,96712484
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

nameops/secsamples
Using String()1,018,299509150
Using brackets {}1,050,992525632
Using '' +1,118,375559241
Using date.toString()1,222,561611281
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

nameops/secsamples
Using delete property4,074,3122037809
Using delete property (proto: null)18,129,5239065350
Using delete property (cached proto: null)4,124,3462062585
Using undefined assignment80,290,40240146936
Using undefined assignment (proto: null)19,629,7829814894
Using undefined property (cached proto: null)77,115,18838557599
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

nameops/secsamples
Error339,539169770
NodeError316,964158635
NodeError Range296,021148298
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

nameops/secsamples
using Array.includes74,168,76637105533
using Array.includes (first item)83,211,76341607427
Using raw comparison97,231,20448615606
Using raw comparison (first item)98,367,87249193854
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

nameops/secsamples
Using Object.keys()41,359,58820682202
Using Object.getOwnPropertyNames()40,697,88120349995
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

nameops/secsamples
Length = 100 - Array.at86,543,39743432706
Length = 10_000 - Array.at83,846,12541951136
Length = 1_000_000 - Array.at90,440,93945222897
Length = 100 - Array[length - 1]81,103,45540555299
Length = 10_000 - Array[length - 1]82,472,49341237383
Length = 1_000_000 - Array[length - 1]88,106,62844053838
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 ~

nameops/secsamples
Math.floor (small)96,310,80148155421
~ (small)97,835,51648929989
Math.floor (long)97,843,47848925594
~ (long)98,508,96949255741
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

nameops/secsamples
Object.create(null)36,811,39418437205
Object.create({})2,152,9231076560
new Function with empty prototype104,020,77752011549
Empty class72,473,08336239929
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

nameops/secsamples
Using parseInt(x, 10) - small number (2 len)98,651,42449325719
Using parseInt(x, 10) - big number (10 len)98,447,91149225485
Using + - small number (2 len)98,448,16349224087
Using + - big number (10 len)98,217,36249110750
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

nameops/secsamples
Using if to check function existence1,178,242602493
Using ? operator to avoid rejection1,234,075617061
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

nameops/secsamples
Raw usage private field96,126,80448063428
Raw usage underscore usage97,220,22448610981
Manipulating private properties using #99,595,02649805529
Manipulating private properties using underscore(_)97,623,82149549111
Manipulating private properties using Symbol96,590,75448295386
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

nameops/secsamples
Adding property after object creation - small object8,059,6984053974
Adding property in the object creation - small object8,213,1594108926
Adding property after the function creation - small class269,563134802
Adding property in the function creation - small class281,158140580
Adding property after the class creation - small class272,781137420
Adding property in the class creation - small class274,067137038
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

nameops/secsamples
Getter (class)95,920,53247960274
Getter50,764,60325382314
Method98,440,35649221059
DefineProperty (getter)95,944,17547974174
DefineProperty (getter & enumerable=false)50,460,10225262768
DefineProperty (getter & configurable=false)94,707,63947561338
DefineProperty (getter & enumerable=false & configurable=false)50,478,77825240215
DefineProperty (writable)96,230,09048115051
DefineProperty (writable & enumerable=false)90,421,60045210807
DefineProperty (writable & enumerable=false & configurable=false)90,960,74145480385
DefineProperties (getter)50,699,86025349935
DefineProperties (getter & enumerable=false)49,955,68924977849
DefineProperties (getter & enumerable=false & configurable=false)50,029,81125038814
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

nameops/secsamples
Setter (class)99,000,45749501792
Setter11,825,2795912753
Method93,913,02346956518
DefineProperty (setter)99,890,79649979105
DefineProperty (setter & enumerable=false)11,759,5635884050
DefineProperty (setter & configurable=false)11,849,2355924927
DefineProperty (setter & enumerable=false & configurable=false)11,992,6035996305
DefineProperty (writable)100,264,21150132111
DefineProperty (writable & enumerable=false)100,733,65150369285
DefineProperty (writable & enumerable=false & configurable=false)101,126,29950563157
DefineProperties (setter)97,010,65048506016
DefineProperties (setter & enumerable=false)11,758,7915882116
DefineProperties (setter & enumerable=false & configurable=false)11,850,2515925139
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

nameops/secsamples
Using replace(//g)3,405,2881703005
Using replaceAll()3,209,7561604895
Using replaceAll(//g)3,083,3281541665
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

nameops/secsamples
{ ...object }25,077,14812576572
{ ...object, proto: null }2,659,5441329773
{ ...object, newProp: true }23,140,48511573129
structuredClone293,877146940
JSON.parse + JSON.stringify310,672155359
loop + object.keys starting with {}1,720,001860074
loop + object.keys starting with { proto: null }912,203456165
loop + object.keys starting with { randomProp: true }672,151336102
object.keys + reduce(FN, {})1,795,307898042
object.keys + reduce(FN, { proto: null })984,592492536
object.keys + reduce(FN, { newProp: true })698,326349255
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

nameops/secsamples
Sort using default323,314161680
Sort using first char1,381,491691037
Sort using localeCompare1,276,849638506
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

nameops/secsamples
{...bigObject} - Total keys: 10001,780891
{...smallObject} - Total keys: 238,592,54019299979
Object.assign({}, bigObject, anotherBigObject) - Total keys: 1000 - creating new object1,064533
Object.assign(bigObject, anotherBigObject) - mutating bigObject6,8223413
{ ...bigObject, ...anotherBigObject }1,116559
Object.assign({}, smallObject, anotherSmallObject) - creating new object12,239,1596119857
Object.assign(smallObject, anotherSmallObject) - mutating smallObject28,583,99614292898
{ ...smallObject, ...anotherSmallObject }21,204,13810602289
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

nameops/secsamples
streams.Readable reading 1e3 * "some data"1,959980
streams.web.Readable reading 1e3 * "some data"1,790896
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

nameops/secsamples
streams.Writable writing 1e3 * "some data"9,2724644
streams.web.WritableStream writing 1e3 * "some data"1,758880
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

nameops/secsamples
Using + sign98,892,90549452831
Using backtick (`)96,660,56448330466
Using array.join9,917,7224966477
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

nameops/secsamples
(short string) (true) String#endsWith90,622,65745313365
(short string) (true) String#slice and strict comparison60,486,38330243197
(long string) (true) String#endsWith62,332,38431172223
(long string) (true) String#slice and strict comparison54,949,53127474769
(short string) (false) String#endsWith95,909,91147955282
(short string) (false) String#slice and strict comparison61,886,33630943172
(long string) (false) String#endsWith89,623,93244811975
(long string) (false) String#slice and strict comparison55,773,62227886819
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

nameops/secsamples
Using includes15,832,9647916484
Using indexof15,965,5787982790
Using RegExp.test13,458,3476729286
Using RegExp.text with cached regex pattern14,501,0737254200
Using new RegExp.test4,761,0472380525
Using new RegExp.test with cached regex pattern5,372,9862686495
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

nameops/secsamples
(short string) (true) String#startsWith91,825,20145946693
(short string) (true) String#slice and strict comparison60,587,98130304356
(long string) (true) String#startsWith59,914,42529960859
(long string) (true) String#slice and strict comparison54,819,24427424195
(short string) (false) String#startsWith95,973,67947997323
(short string) (false) String#slice and strict comparison61,470,93730743123
(long string) (false) String#startsWith88,951,96944800061
(long string) (false) String#slice and strict comparison55,347,97027674485
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

nameops/secsamples
Using super95,194,70547613722
Using this97,845,93049405515
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

nameops/secsamples
new Date().getTime()10,702,9945351583
Date.now()19,809,8339904918
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