RESULTS-v20.md

October 17, 2025 ยท View on GitHub

Adding property

nameops/secsamples
Directly in the object81,417,98840709516
Using dot notation76,899,99138461944
Using define property (writable)4,556,6452279209
Using define property initialized (writable)6,029,0203014611
Using define property (getter)2,162,0231081012
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)

typeamounttime elapsed
array.push100.004ms
new Array(length)100.002ms
array.push1000.112ms
new Array(length)1000.009ms
array.push1,0000.03ms
new Array(length)1,0000.015ms
array.push10,0000.266ms
new Array(length)10,0000.301ms
array.push1,000,00033.188ms
new Array(length)1,000,0007.663ms
array.push10,000,000235.34ms
new Array(length)10,000,00067.158ms

Array.append (string)

typeamounttime elapsed
array.push100.004ms
new Array(length)100.004ms
array.push1000.013ms
new Array(length)1000.011ms
array.push1,0000.041ms
new Array(length)1,0000.021ms
array.push10,0000.236ms
new Array(length)10,0000.24ms
array.push1,000,00026.072ms
new Array(length)1,000,0008.288ms
array.push10,000,000211.079ms
new Array(length)10,000,00066.028ms

Array Creation

nameops/secsamples
new Array250126
Array.from2212
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

nameops/secsamples
new Blob (128)4,0232050
new Blob (1024)507254
text (128)4,4882245
text (1024)567284
arrayBuffer (128)4,4862249
arrayBuffer (1024)557281
slice (0, 64)61,64730824
slice (0, 512)24,98512498
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

nametotal timesamples
Deflate133.43 ms1
Gzip134.28 ms1
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

nameops/secsamples
crypto.createVerify('RSA-SHA256')6,0263014
crypto.verify('RSA-SHA256')6,6633347
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

nameops/secsamples
new Date().toISOString()1,407,893704024
fromUnixToISOString(new Date())2,100,4191050210
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

nameops/secsamples
Intl.DateTimeFormat().format(Date.now())19,5859822
Intl.DateTimeFormat().format(new Date())19,2289615
Intl.DateTimeFormat(undefined, twoDigitsLocaleOptions).format(Date.now())19,9319980
Intl.DateTimeFormat(undefined, twoDigitsLocaleOptions).format(new Date())18,8959448
Reusing Intl.DateTimeFormat()424,291212148
Date.toLocaleDateString()964,520482382
Date.toLocaleDateString(undefined, twoDigitsLocaleOptions)23,45411728
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

nameops/secsamples
Using String()1,090,408545224
Using brackets {}1,056,805528403
Using '' +1,004,508502356
Using date.toString()1,187,910593956
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

nameops/secsamples
Using delete property3,734,7261867732
Using delete property (proto: null)17,362,0938681053
Using delete property (cached proto: null)3,767,4561883987
Using undefined assignment85,936,50742972401
Using undefined assignment (proto: null)18,490,5569249688
Using undefined property (cached proto: null)86,230,20943115112
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

nameops/secsamples
Error304,696152349
NodeError286,150144034
NodeError Range267,201133601
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

nameops/secsamples
using Array.includes72,406,13736207588
using Array.includes (first item)85,571,66642795786
Using raw comparison100,052,77750038639
Using raw comparison (first item)97,540,16348778855
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

nameops/secsamples
Using Object.keys()43,498,51121749256
Using Object.getOwnPropertyNames()47,956,38023978852
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

nameops/secsamples
Length = 100 - Array.at99,451,06449737463
Length = 10_000 - Array.at90,292,74445146380
Length = 1_000_000 - Array.at97,429,20848714614
Length = 100 - Array[length - 1]98,159,32449080886
Length = 10_000 - Array[length - 1]98,676,99349338517
Length = 1_000_000 - Array[length - 1]99,648,39149829656
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 ~

nameops/secsamples
Math.floor (small)99,299,25049698868
~ (small)101,898,95550949483
Math.floor (long)102,297,18451148594
~ (long)101,941,40550970705
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

nameops/secsamples
Object.create(null)36,691,19518478586
Object.create({})1,931,102965564
new Function with empty prototype71,160,28735580556
Empty class79,174,29639591942
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

nameops/secsamples
Using parseInt(x, 10) - small number (2 len)100,671,55350339367
Using parseInt(x, 10) - big number (10 len)101,338,82150670540
Using + - small number (2 len)97,698,28948852125
Using + - big number (10 len)103,049,27951524654
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

nameops/secsamples
Using if to check function existence734,964368458
Using ? operator to avoid rejection831,142415572
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

nameops/secsamples
Raw usage private field100,626,94250314198
Raw usage underscore usage101,013,96250522941
Manipulating private properties using #101,352,14250676219
Manipulating private properties using underscore(_)101,706,60450853330
Manipulating private properties using Symbol102,464,40951233400
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

nameops/secsamples
Adding property after object creation - small object7,598,4483799478
Adding property in the object creation - small object7,628,4763814565
Adding property after the function creation - small class234,888118570
Adding property in the function creation - small class244,555122963
Adding property after the class creation - small class236,662118775
Adding property in the class creation - small class230,108115055
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

nameops/secsamples
Getter (class)99,423,75949713915
Getter54,024,16627012089
Method101,270,02350635018
DefineProperty (getter)94,354,25947177148
DefineProperty (getter & enumerable=false)53,662,82326831415
DefineProperty (getter & configurable=false)101,332,59550674984
DefineProperty (getter & enumerable=false & configurable=false)53,772,81626890609
DefineProperty (writable)100,879,48750473134
DefineProperty (writable & enumerable=false)100,534,19450269084
DefineProperty (writable & enumerable=false & configurable=false)97,905,64748979962
DefineProperties (getter)52,938,68326471255
DefineProperties (getter & enumerable=false)53,774,83626887430
DefineProperties (getter & enumerable=false & configurable=false)53,711,38526855695
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

nameops/secsamples
Setter (class)102,069,69051035268
Setter11,434,2415717124
Method99,749,15749874585
DefineProperty (setter)100,287,69250143854
DefineProperty (setter & enumerable=false)11,697,6945850014
DefineProperty (setter & configurable=false)11,549,4895775576
DefineProperty (setter & enumerable=false & configurable=false)11,526,7495763375
DefineProperty (writable)101,629,04550814546
DefineProperty (writable & enumerable=false)105,027,17552513598
DefineProperty (writable & enumerable=false & configurable=false)103,265,57351649470
DefineProperties (setter)97,049,76848541740
DefineProperties (setter & enumerable=false)11,567,4295783716
DefineProperties (setter & enumerable=false & configurable=false)11,721,4935860757
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

nameops/secsamples
Using replace(//g)3,525,2421762914
Using replaceAll()3,019,7151510013
Using replaceAll(//g)3,170,9631585718
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

nameops/secsamples
{ ...object }22,099,89511050181
{ ...object, proto: null }22,147,30311073980
{ ...object, newProp: true }849,651424827
structuredClone293,455146798
JSON.parse + JSON.stringify193,35996680
loop + object.keys starting with {}1,516,501758488
loop + object.keys starting with { proto: null }784,118392061
loop + object.keys starting with { randomProp: true }532,585266317
object.keys + reduce(FN, {})1,540,095770072
object.keys + reduce(FN, { proto: null })803,066401662
object.keys + reduce(FN, { newProp: true })523,614261808
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

nameops/secsamples
Sort using default271,300135843
Sort using first char1,372,589686310
Sort using localeCompare1,270,980635621
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

nameops/secsamples
{...bigObject} - Total keys: 10001,762882
{...smallObject} - Total keys: 240,177,32620110526
Object.assign({}, bigObject, anotherBigObject) - Total keys: 1000 - creating new object1,064533
Object.assign(bigObject, anotherBigObject) - mutating bigObject6,6643333
{ ...bigObject, ...anotherBigObject }1,115559
Object.assign({}, smallObject, anotherSmallObject) - creating new object12,192,1656096487
Object.assign(smallObject, anotherSmallObject) - mutating smallObject28,954,58514477300
{ ...smallObject, ...anotherSmallObject }20,610,26810305401
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

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

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

nameops/secsamples
Using + sign100,144,04150072033
Using backtick (`)97,570,71048815233
Using array.join10,991,8385497655
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

nameops/secsamples
(short string) (true) String#endsWith54,067,53227034262
(short string) (true) String#slice and strict comparison65,051,24832525908
(long string) (true) String#endsWith50,651,40125364735
(long string) (true) String#slice and strict comparison59,335,70229670920
(short string) (false) String#endsWith59,226,97929613506
(short string) (false) String#slice and strict comparison63,804,46531904716
(long string) (false) String#endsWith55,235,77327617904
(long string) (false) String#slice and strict comparison58,466,09629233833
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

nameops/secsamples
Using includes16,220,0578116578
Using indexof16,161,8668080936
Using RegExp.test13,570,9066786147
Using RegExp.text with cached regex pattern14,231,6387115821
Using new RegExp.test4,383,8342191919
Using new RegExp.test with cached regex pattern4,987,9192494535
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

nameops/secsamples
(short string) (true) String#startsWith83,015,17241507594
(short string) (true) String#slice and strict comparison64,776,61832395836
(long string) (true) String#startsWith65,506,88132753554
(long string) (true) String#slice and strict comparison59,135,71729596858
(short string) (false) String#startsWith100,348,02350174018
(short string) (false) String#slice and strict comparison63,775,93231887971
(long string) (false) String#startsWith92,647,50746323904
(long string) (false) String#slice and strict comparison58,624,93029320594
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

nameops/secsamples
Using super93,301,92746651565
Using this100,462,51150231276
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

nameops/secsamples
new Date().getTime()11,114,4605557611
Date.now()20,674,59310337397
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