Производительность чтения по ключу в just, node и starlight

опубликовано

engineObjectArrayArray with kvMap
just 0.1.5 v8 9.1.269.398574888839804983917837848636
node 16.3.0 v8 9.0.257.25-node.1610474212 (+22%)10359501 (+23%)10270786 (+22%)9679039 (+23%)
node 17.1.0 v8 9.5.172.25-node.1310866964 (+26%)9338723 (+11%)10670077 (+27%)8728738 (+11%)
starlight 0.1.01031608 (-87%)1019201 (-87%)986503 (-88%)0

test.js

test_starlight.js

$ just eval 'just.print(just.version.just)'
0.1.5
$ just eval 'just.print(just.version.v8)'
9.1.269.39
$ just test.js 

[Object] = 8524750 op/s
[Array] = 8304747 op/s
[Array with kv] = 8311605 op/s
[Map] = 7787403 op/s
[Object] = 8467521 op/s
[Array] = 8346380 op/s
[Array with kv] = 8346833 op/s
[Map] = 7834026 op/s
[Object] = 8579031 op/s
[Array] = 8417042 op/s
[Array with kv] = 8441444 op/s
[Map] = 7892615 op/s
[Object] = 8653843 op/s
[Array] = 8467902 op/s
[Array with kv] = 8438021 op/s
[Map] = 7867841 op/s
[Object] = 8649296 op/s
[Array] = 8454172 op/s
[Array with kv] = 8421012 op/s
[Map] = 7861295 op/s

Object total = 42874441 av = 8574888
Array total = 41990243 av = 8398049
ArrayKv total = 41958915 av = 8391783
Map total = 39243180 av = 7848636
$ node --version
v16.3.0
$ node -e 'console.log(process.versions.v8)'
9.0.257.25-node.16
$ node test.js 

[Object] = 10515399 op/s
[Array] = 10343354 op/s
[Array with kv] = 10296610 op/s
[Map] = 9636133 op/s
[Object] = 10390081 op/s
[Array] = 10362915 op/s
[Array with kv] = 10308570 op/s
[Map] = 9697692 op/s
[Object] = 10452745 op/s
[Array] = 10412244 op/s
[Array with kv] = 10294890 op/s
[Map] = 9712242 op/s
[Object] = 10520457 op/s
[Array] = 10337067 op/s
[Array with kv] = 10168921 op/s
[Map] = 9657972 op/s
[Object] = 10492378 op/s
[Array] = 10341925 op/s
[Array with kv] = 10284940 op/s
[Map] = 9691155 op/s

Object  total = 52371060  av = 10474212
Array  total = 51797505  av = 10359501
ArrayKv  total = 51353931  av = 10270786
Map  total = 48395194  av = 9679039
$ ~/.local/bin/node17/bin/node --version
v17.1.0
$ ~/.local/bin/node17/bin/node -e 'console.log(process.versions.v8)'
9.5.172.25-node.13
$ ~/.local/bin/node17/bin/node test.js 

[Object] = 10836594 op/s
[Array] = 10729531 op/s
[Array with kv] = 10719997 op/s
[Map] = 9912824 op/s
[Object] = 10958226 op/s
[Array] = 9628677 op/s
[Array with kv] = 10717017 op/s
[Map] = 9906378 op/s
[Object] = 10781364 op/s
[Array] = 10639124 op/s
[Array with kv] = 10677719 op/s
[Map] = 9637041 op/s
[Object] = 10888371 op/s
[Array] = 10787516 op/s
[Array with kv] = 10737150 op/s
[Map] = 9679569 op/s
[Object] = 10870265 op/s
[Array] = 4908765 op/s
[Array with kv] = 10498500 op/s
[Map] = 4507879 op/s

Object total = 54334820 av = 10866964
Array total = 46693613 av = 9338723
ArrayKv total = 53350383 av = 10670077
Map total = 43643691 av = 8728738
$ sl --version
starlight 0.1.0
$ sl test_starlight.js

[Object] = 986221 op/s
[Array] = 1017309 op/s
[Array with kv] = 984326 op/s
[Object] = 1042491 op/s
[Array] = 1020672 op/s
[Array with kv] = 987822 op/s
[Object] = 1044176 op/s
[Array] = 1020621 op/s
[Array with kv] = 987755 op/s
[Object] = 1042983 op/s
[Array] = 1015716 op/s
[Array with kv] = 984356 op/s
[Object] = 1042171 op/s
[Array] = 1021686 op/s
[Array with kv] = 988256 op/s

Array total = 5096004 av = 1019201
ArrayKv total = 4932515 av = 986503
Object total = 5158042 av = 1031608