Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add tests workflow for bun and deno #423

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

nazarhussain
Copy link
Contributor

@nazarhussain nazarhussain commented Nov 21, 2024

Motivation

Make the packages compatible with Deno+Bun.

Description

  • Make unit tests compatible with Deno+Bun
  • Make spec tests compatible with Deno+Bun

Steps to test or reproduce

  • Run all tests

@nazarhussain nazarhussain changed the title Add tests workflow for deno chore: add tests workflow for deno Nov 21, 2024
@nazarhussain nazarhussain changed the title chore: add tests workflow for deno feat: add tests workflow for deno Nov 21, 2024
@nazarhussain nazarhussain marked this pull request as ready for review November 21, 2024 13:54
@nazarhussain nazarhussain requested a review from a team as a code owner November 21, 2024 13:54
@nazarhussain nazarhussain self-assigned this Nov 22, 2024
@twoeths
Copy link
Contributor

twoeths commented Nov 25, 2024

while I see the improvement on the source code, like not to import lib from other modules, I don't see why do we have to pick Deno and make sure lodestar to be compliant to it? there are a lot of deno specific resources added in this PR

I guess we need to put this on hold until we have final approach on which javascript runtime that lodestar want to experiment ChainSafe/lodestar#7237

@nazarhussain
Copy link
Contributor Author

nazarhussain commented Nov 25, 2024

while I see the improvement on the source code, like not to import lib from other modules, I don't see why do we have to pick Deno and make sure lodestar to be compliant to it? there are a lot of deno specific resources added in this PR

Deno is needed/recommended to publish packages to jsr.io which is intention to test with deno first in this PR.

And here is the details that why I am moving to support jsr.io https://jsr.io/docs/why

@twoeths
Copy link
Contributor

twoeths commented Nov 26, 2024

Does Bun support jsr.io?

if yes I'd go with Bun as we'll most likely to go with it. Again, need to wait for the final decision on ChainSafe/lodestar#7237

if both NodeJS + Bun don't support jsr.io, only Deno does then we need to see if it's a must to support jsr.io. I found it weird to target Bun/NodeJS while having Deno specific resources in the repo

@nazarhussain
Copy link
Contributor Author

Does Bun support jsr.io?

jsr.io is a registry developed and maintained by Bun for typescript based packages. As it follow modern standards it's compatible with all runtimes. As it's mentioned on there website.

JSR modules can be used in Node.js, Deno, Bun, Cloudflare Workers, and more.

@nazarhussain nazarhussain changed the title feat: add tests workflow for deno feat: add tests workflow for bun and deno Dec 17, 2024
@nazarhussain nazarhussain changed the base branch from feature/deno to master January 17, 2025 15:59
@nazarhussain nazarhussain changed the base branch from master to feature/deno January 17, 2025 15:59
@nazarhussain nazarhussain changed the base branch from feature/deno to master January 17, 2025 16:11
Copy link

github-actions bot commented Jan 17, 2025

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 93a3fca Previous: 7c6ce61 Ratio
digestTwoHashObjects 50023 times 48.538 ms/op 48.741 ms/op 1.00
digest2Bytes32 50023 times 54.614 ms/op 54.968 ms/op 0.99
digest 50023 times 53.718 ms/op 53.952 ms/op 1.00
input length 32 1.1900 us/op 1.1960 us/op 0.99
input length 64 1.3030 us/op 1.3280 us/op 0.98
input length 128 2.2690 us/op 2.2820 us/op 0.99
input length 256 3.3700 us/op 3.3600 us/op 1.00
input length 512 5.6250 us/op 5.5210 us/op 1.02
input length 1024 10.884 us/op 10.735 us/op 1.01
digest 1000000 times 860.15 ms/op 875.60 ms/op 0.98
hashObjectToByteArray 50023 times 1.2291 ms/op 1.2286 ms/op 1.00
byteArrayToHashObject 50023 times 1.5576 ms/op 1.6813 ms/op 0.93
digest64 200092 times 212.36 ms/op 214.14 ms/op 0.99
hash 200092 times using batchHash4UintArray64s 233.94 ms/op 236.28 ms/op 0.99
digest64HashObjects 200092 times 192.48 ms/op 193.58 ms/op 0.99
hash 200092 times using batchHash4HashObjectInputs 197.29 ms/op 195.48 ms/op 1.01
getGindicesAtDepth 3.4680 us/op 3.6810 us/op 0.94
iterateAtDepth 6.2780 us/op 6.6460 us/op 0.94
getGindexBits 395.00 ns/op 409.00 ns/op 0.97
gindexIterator 837.00 ns/op 895.00 ns/op 0.94
HashComputationLevel.push then loop 25.852 ms/op 26.791 ms/op 0.96
HashComputation[] push then loop 47.701 ms/op 39.357 ms/op 1.21
hash 2 Uint8Array 500000 times - hashtree 215.77 ms/op 220.11 ms/op 0.98
hashTwoObjects 500000 times - hashtree 219.86 ms/op 241.68 ms/op 0.91
executeHashComputations - hashtree 9.4746 ms/op 10.193 ms/op 0.93
hash 2 Uint8Array 500000 times - as-sha256 553.41 ms/op 567.94 ms/op 0.97
hashTwoObjects 500000 times - as-sha256 510.60 ms/op 510.93 ms/op 1.00
executeHashComputations - as-sha256 45.576 ms/op 45.601 ms/op 1.00
hash 2 Uint8Array 500000 times - noble 1.2133 s/op 1.3025 s/op 0.93
hashTwoObjects 500000 times - noble 1.6345 s/op 1.8027 s/op 0.91
executeHashComputations - noble 36.875 ms/op 37.356 ms/op 0.99
getHashComputations 2.2226 ms/op 2.5649 ms/op 0.87
executeHashComputations 10.520 ms/op 9.7450 ms/op 1.08
get root 16.252 ms/op 15.677 ms/op 1.04
getNodeH() x7812.5 avg hindex 12.406 us/op 12.437 us/op 1.00
getNodeH() x7812.5 index 0 7.4880 us/op 7.5120 us/op 1.00
getNodeH() x7812.5 index 7 7.5470 us/op 7.5440 us/op 1.00
getNodeH() x7812.5 index 7 with key array 6.3620 us/op 6.3990 us/op 0.99
new LeafNode() x7812.5 310.63 us/op 476.32 us/op 0.65
getHashComputations 250000 nodes 14.695 ms/op 16.139 ms/op 0.91
batchHash 250000 nodes 86.585 ms/op 88.603 ms/op 0.98
get root 250000 nodes 119.85 ms/op 117.13 ms/op 1.02
getHashComputations 500000 nodes 33.131 ms/op 29.204 ms/op 1.13
batchHash 500000 nodes 172.86 ms/op 159.73 ms/op 1.08
get root 500000 nodes 243.41 ms/op 234.32 ms/op 1.04
getHashComputations 1000000 nodes 97.466 ms/op 83.344 ms/op 1.17
batchHash 1000000 nodes 335.98 ms/op 386.32 ms/op 0.87
get root 1000000 nodes 474.91 ms/op 473.15 ms/op 1.00
multiproof - depth 15, 1 requested leaves 7.7660 us/op 8.7460 us/op 0.89
tree offset multiproof - depth 15, 1 requested leaves 17.304 us/op 19.798 us/op 0.87
compact multiproof - depth 15, 1 requested leaves 2.9560 us/op 3.4110 us/op 0.87
multiproof - depth 15, 2 requested leaves 11.094 us/op 12.441 us/op 0.89
tree offset multiproof - depth 15, 2 requested leaves 20.380 us/op 23.255 us/op 0.88
compact multiproof - depth 15, 2 requested leaves 2.9510 us/op 3.5800 us/op 0.82
multiproof - depth 15, 3 requested leaves 15.635 us/op 16.807 us/op 0.93
tree offset multiproof - depth 15, 3 requested leaves 27.128 us/op 29.015 us/op 0.93
compact multiproof - depth 15, 3 requested leaves 3.5520 us/op 4.3050 us/op 0.83
multiproof - depth 15, 4 requested leaves 20.793 us/op 23.975 us/op 0.87
tree offset multiproof - depth 15, 4 requested leaves 33.016 us/op 38.410 us/op 0.86
compact multiproof - depth 15, 4 requested leaves 4.1590 us/op 5.7290 us/op 0.73
packedRootsBytesToLeafNodes bytes 4000 offset 0 5.4060 us/op 6.3680 us/op 0.85
packedRootsBytesToLeafNodes bytes 4000 offset 1 5.5020 us/op 6.2690 us/op 0.88
packedRootsBytesToLeafNodes bytes 4000 offset 2 5.4050 us/op 6.6780 us/op 0.81
packedRootsBytesToLeafNodes bytes 4000 offset 3 5.4080 us/op 6.2530 us/op 0.86
subtreeFillToContents depth 40 count 250000 42.247 ms/op 49.117 ms/op 0.86
setRoot - gindexBitstring 22.935 ms/op 27.897 ms/op 0.82
setRoot - gindex 22.176 ms/op 25.670 ms/op 0.86
getRoot - gindexBitstring 2.5502 ms/op 2.9305 ms/op 0.87
getRoot - gindex 3.3378 ms/op 3.6564 ms/op 0.91
getHashObject then setHashObject 22.888 ms/op 28.342 ms/op 0.81
setNodeWithFn 20.175 ms/op 25.055 ms/op 0.81
getNodeAtDepth depth 0 x100000 280.05 us/op 280.21 us/op 1.00
setNodeAtDepth depth 0 x100000 2.6695 ms/op 2.7490 ms/op 0.97
getNodesAtDepth depth 0 x100000 312.39 us/op 312.17 us/op 1.00
setNodesAtDepth depth 0 x100000 757.32 us/op 759.63 us/op 1.00
getNodeAtDepth depth 1 x100000 342.06 us/op 342.64 us/op 1.00
setNodeAtDepth depth 1 x100000 8.3400 ms/op 8.9980 ms/op 0.93
getNodesAtDepth depth 1 x100000 436.07 us/op 437.36 us/op 1.00
setNodesAtDepth depth 1 x100000 7.0938 ms/op 9.3770 ms/op 0.76
getNodeAtDepth depth 2 x100000 797.81 us/op 763.59 us/op 1.04
setNodeAtDepth depth 2 x100000 15.490 ms/op 19.032 ms/op 0.81
getNodesAtDepth depth 2 x100000 18.004 ms/op 20.630 ms/op 0.87
setNodesAtDepth depth 2 x100000 22.534 ms/op 28.564 ms/op 0.79
tree.getNodesAtDepth - gindexes 8.8197 ms/op 11.896 ms/op 0.74
tree.getNodesAtDepth - push all nodes 2.4728 ms/op 2.8585 ms/op 0.87
tree.getNodesAtDepth - navigation 311.24 us/op 313.88 us/op 0.99
tree.setNodesAtDepth - indexes 780.25 us/op 923.31 us/op 0.85
set at depth 8 795.00 ns/op 970.00 ns/op 0.82
set at depth 16 1.1900 us/op 1.3770 us/op 0.86
set at depth 32 2.0030 us/op 2.2330 us/op 0.90
iterateNodesAtDepth 8 256 15.157 us/op 15.276 us/op 0.99
getNodesAtDepth 8 256 3.8820 us/op 4.1460 us/op 0.94
iterateNodesAtDepth 16 65536 4.5410 ms/op 5.4222 ms/op 0.84
getNodesAtDepth 16 65536 2.1128 ms/op 1.6474 ms/op 1.28
iterateNodesAtDepth 32 250000 18.369 ms/op 16.120 ms/op 1.14
getNodesAtDepth 32 250000 5.2654 ms/op 4.6920 ms/op 1.12
iterateNodesAtDepth 40 250000 16.125 ms/op 16.458 ms/op 0.98
getNodesAtDepth 40 250000 4.5701 ms/op 4.6999 ms/op 0.97
250000 validators root getter 122.46 ms/op 118.17 ms/op 1.04
250000 validators batchHash() 87.638 ms/op 100.34 ms/op 0.87
250000 validators hashComputations 14.956 ms/op 19.620 ms/op 0.76
bitlist bytes to struct (120,90) 1.0250 us/op 837.00 ns/op 1.22
bitlist bytes to tree (120,90) 3.7430 us/op 2.8810 us/op 1.30
bitlist bytes to struct (2048,2048) 1.3790 us/op 1.6100 us/op 0.86
bitlist bytes to tree (2048,2048) 5.8240 us/op 6.0540 us/op 0.96
ByteListType - deserialize 9.0899 ms/op 12.644 ms/op 0.72
BasicListType - deserialize 18.133 ms/op 16.531 ms/op 1.10
ByteListType - serialize 8.0144 ms/op 8.4285 ms/op 0.95
BasicListType - serialize 10.811 ms/op 10.689 ms/op 1.01
BasicListType - tree_convertToStruct 31.014 ms/op 27.664 ms/op 1.12
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 5.1319 ms/op 5.1153 ms/op 1.00
List[uint8, 68719476736] len 300000 ViewDU.get(i) 4.3193 ms/op 4.2448 ms/op 1.02
Array.push len 300000 empty Array - number 7.5594 ms/op 7.3303 ms/op 1.03
Array.set len 300000 from new Array - number 2.2870 ms/op 1.7864 ms/op 1.28
Array.set len 300000 - number 6.4010 ms/op 6.2250 ms/op 1.03
Uint8Array.set len 300000 489.55 us/op 494.41 us/op 0.99
Uint32Array.set len 300000 558.00 us/op 574.07 us/op 0.97
Container({a: uint8, b: uint8}) getViewDU x300000 25.861 ms/op 26.477 ms/op 0.98
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 11.223 ms/op 11.200 ms/op 1.00
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 213.93 ms/op 220.88 ms/op 0.97
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 251.01 ms/op 274.70 ms/op 0.91
List(Container) len 300000 ViewDU.get(i) 6.6502 ms/op 7.4201 ms/op 0.90
List(Container) len 300000 ViewDU.getReadonly(i) 6.4989 ms/op 7.2268 ms/op 0.90
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 34.260 ms/op 38.620 ms/op 0.89
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 6.5171 ms/op 5.7864 ms/op 1.13
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 6.4428 ms/op 6.5384 ms/op 0.99
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 6.1994 ms/op 6.8361 ms/op 0.91
Array.push len 300000 empty Array - object 6.4364 ms/op 7.0619 ms/op 0.91
Array.set len 300000 from new Array - object 1.9256 ms/op 2.0874 ms/op 0.92
Array.set len 300000 - object 6.0971 ms/op 6.7077 ms/op 0.91
cachePermanentRootStruct no cache 5.2880 us/op 5.8700 us/op 0.90
cachePermanentRootStruct with cache 207.00 ns/op 234.00 ns/op 0.88
epochParticipation len 250000 rws 7813 2.3478 ms/op 2.3194 ms/op 1.01
BeaconState ViewDU hashTreeRoot() vc=200000 113.23 ms/op 116.98 ms/op 0.97
BeaconState ViewDU recursive hash - commit step vc=200000 4.5875 ms/op 4.9737 ms/op 0.92
BeaconState ViewDU validator tree creation vc=10000 40.878 ms/op 40.516 ms/op 1.01
BeaconState ViewDU batchHashTreeRoot vc=200000 102.15 ms/op 108.20 ms/op 0.94
BeaconState ViewDU hashTreeRoot - commit step vc=200000 90.904 ms/op 95.600 ms/op 0.95
BeaconState ViewDU hashTreeRoot - hash step vc=200000 16.632 ms/op 20.308 ms/op 0.82
deserialize Attestation - tree 3.9040 us/op 4.3040 us/op 0.91
deserialize Attestation - struct 2.0740 us/op 2.1940 us/op 0.95
deserialize SignedAggregateAndProof - tree 4.9590 us/op 5.5320 us/op 0.90
deserialize SignedAggregateAndProof - struct 3.0570 us/op 3.4880 us/op 0.88
deserialize SyncCommitteeMessage - tree 1.5240 us/op 1.5930 us/op 0.96
deserialize SyncCommitteeMessage - struct 1.0240 us/op 1.1390 us/op 0.90
deserialize SignedContributionAndProof - tree 3.0730 us/op 3.1490 us/op 0.98
deserialize SignedContributionAndProof - struct 2.3870 us/op 2.8310 us/op 0.84
deserialize SignedBeaconBlock - tree 283.90 us/op 340.28 us/op 0.83
deserialize SignedBeaconBlock - struct 120.03 us/op 147.16 us/op 0.82
BeaconState vc 300000 - deserialize tree 630.27 ms/op 677.60 ms/op 0.93
BeaconState vc 300000 - serialize tree 125.57 ms/op 133.11 ms/op 0.94
BeaconState.historicalRoots vc 300000 - deserialize tree 893.00 ns/op 868.00 ns/op 1.03
BeaconState.historicalRoots vc 300000 - serialize tree 717.00 ns/op 738.00 ns/op 0.97
BeaconState.validators vc 300000 - deserialize tree 566.01 ms/op 643.85 ms/op 0.88
BeaconState.validators vc 300000 - serialize tree 114.52 ms/op 110.95 ms/op 1.03
BeaconState.balances vc 300000 - deserialize tree 28.170 ms/op 26.714 ms/op 1.05
BeaconState.balances vc 300000 - serialize tree 3.9236 ms/op 4.2914 ms/op 0.91
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 951.64 us/op 1.0537 ms/op 0.90
BeaconState.previousEpochParticipation vc 300000 - serialize tree 336.64 us/op 325.70 us/op 1.03
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 997.14 us/op 1.0264 ms/op 0.97
BeaconState.currentEpochParticipation vc 300000 - serialize tree 340.68 us/op 327.56 us/op 1.04
BeaconState.inactivityScores vc 300000 - deserialize tree 25.632 ms/op 26.985 ms/op 0.95
BeaconState.inactivityScores vc 300000 - serialize tree 4.6413 ms/op 5.0875 ms/op 0.91
hashTreeRoot Attestation - struct 24.582 us/op 21.132 us/op 1.16
hashTreeRoot Attestation - tree 9.5470 us/op 9.4350 us/op 1.01
hashTreeRoot SignedAggregateAndProof - struct 27.785 us/op 34.495 us/op 0.81
hashTreeRoot SignedAggregateAndProof - tree 14.546 us/op 14.150 us/op 1.03
hashTreeRoot SyncCommitteeMessage - struct 7.0820 us/op 7.0070 us/op 1.01
hashTreeRoot SyncCommitteeMessage - tree 3.9920 us/op 3.4740 us/op 1.15
hashTreeRoot SignedContributionAndProof - struct 19.299 us/op 17.568 us/op 1.10
hashTreeRoot SignedContributionAndProof - tree 9.7990 us/op 9.7030 us/op 1.01
hashTreeRoot SignedBeaconBlock - struct 1.3316 ms/op 1.4744 ms/op 0.90
hashTreeRoot SignedBeaconBlock - tree 848.16 us/op 846.04 us/op 1.00
hashTreeRoot Validator - struct 8.3850 us/op 9.7090 us/op 0.86
hashTreeRoot Validator - tree 7.5300 us/op 8.5330 us/op 0.88
BeaconState vc 300000 - hashTreeRoot tree 2.2969 s/op 2.4313 s/op 0.94
BeaconState vc 300000 - batchHashTreeRoot tree 4.1761 s/op 4.3691 s/op 0.96
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 1.0430 us/op 1.1900 us/op 0.88
BeaconState.validators vc 300000 - hashTreeRoot tree 2.5003 s/op 2.6390 s/op 0.95
BeaconState.balances vc 300000 - hashTreeRoot tree 36.118 ms/op 39.599 ms/op 0.91
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 4.4441 ms/op 4.4652 ms/op 1.00
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 4.4648 ms/op 4.4568 ms/op 1.00
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 36.480 ms/op 38.099 ms/op 0.96
hash64 x18 9.1280 us/op 9.5420 us/op 0.96
hashTwoObjects x18 8.4280 us/op 8.2650 us/op 1.02
hash64 x1740 806.95 us/op 857.79 us/op 0.94
hashTwoObjects x1740 784.23 us/op 768.58 us/op 1.02
hash64 x2700000 1.3006 s/op 1.3336 s/op 0.98
hashTwoObjects x2700000 1.2186 s/op 1.2011 s/op 1.01
get_exitEpoch - ContainerType 268.00 ns/op 271.00 ns/op 0.99
get_exitEpoch - ContainerNodeStructType 243.00 ns/op 287.00 ns/op 0.85
set_exitEpoch - ContainerType 295.00 ns/op 294.00 ns/op 1.00
set_exitEpoch - ContainerNodeStructType 259.00 ns/op 289.00 ns/op 0.90
get_pubkey - ContainerType 958.00 ns/op 1.1720 us/op 0.82
get_pubkey - ContainerNodeStructType 256.00 ns/op 266.00 ns/op 0.96
hashTreeRoot - ContainerType 471.00 ns/op 495.00 ns/op 0.95
hashTreeRoot - ContainerNodeStructType 406.00 ns/op 497.00 ns/op 0.82
createProof - ContainerType 4.1950 us/op 4.7680 us/op 0.88
createProof - ContainerNodeStructType 22.233 us/op 25.838 us/op 0.86
serialize - ContainerType 1.7170 us/op 1.9290 us/op 0.89
serialize - ContainerNodeStructType 1.5170 us/op 1.5880 us/op 0.96
set_exitEpoch_and_hashTreeRoot - ContainerType 3.0610 us/op 3.0970 us/op 0.99
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 8.2380 us/op 8.2850 us/op 0.99
Array - for of 9.3880 us/op 6.8240 us/op 1.38
Array - for(;;) 9.5560 us/op 6.7380 us/op 1.42
basicListValue.readonlyValuesArray() 5.2867 ms/op 6.4371 ms/op 0.82
basicListValue.readonlyValuesArray() + loop all 5.2017 ms/op 6.2529 ms/op 0.83
compositeListValue.readonlyValuesArray() 30.020 ms/op 32.589 ms/op 0.92
compositeListValue.readonlyValuesArray() + loop all 30.536 ms/op 30.299 ms/op 1.01
Number64UintType - get balances list 4.5875 ms/op 4.9520 ms/op 0.93
Number64UintType - set balances list 9.9625 ms/op 10.211 ms/op 0.98
Number64UintType - get and increase 10 then set 45.525 ms/op 40.453 ms/op 1.13
Number64UintType - increase 10 using applyDelta 16.565 ms/op 15.113 ms/op 1.10
Number64UintType - increase 10 using applyDeltaInBatch 16.407 ms/op 15.012 ms/op 1.09
tree_newTreeFromUint64Deltas 22.331 ms/op 20.309 ms/op 1.10
unsafeUint8ArrayToTree 38.121 ms/op 42.927 ms/op 0.89
bitLength(50) 244.00 ns/op 278.00 ns/op 0.88
bitLengthStr(50) 222.00 ns/op 249.00 ns/op 0.89
bitLength(8000) 225.00 ns/op 270.00 ns/op 0.83
bitLengthStr(8000) 258.00 ns/op 285.00 ns/op 0.91
bitLength(250000) 238.00 ns/op 284.00 ns/op 0.84
bitLengthStr(250000) 300.00 ns/op 373.00 ns/op 0.80
floor - Math.floor (53) 1.2440 ns/op 1.2438 ns/op 1.00
floor - << 0 (53) 1.2564 ns/op 1.2444 ns/op 1.01
floor - Math.floor (512) 1.2453 ns/op 1.2434 ns/op 1.00
floor - << 0 (512) 1.2432 ns/op 1.2439 ns/op 1.00
fnIf(0) 1.5539 ns/op 1.5541 ns/op 1.00
fnSwitch(0) 2.1776 ns/op 2.1772 ns/op 1.00
fnObj(0) 1.5663 ns/op 1.5679 ns/op 1.00
fnArr(0) 1.5548 ns/op 1.5725 ns/op 0.99
fnIf(4) 2.1971 ns/op 2.1776 ns/op 1.01
fnSwitch(4) 2.1768 ns/op 2.1775 ns/op 1.00
fnObj(4) 1.5553 ns/op 1.5747 ns/op 0.99
fnArr(4) 1.5546 ns/op 1.5550 ns/op 1.00
fnIf(9) 3.1061 ns/op 3.1422 ns/op 0.99
fnSwitch(9) 2.2110 ns/op 2.1840 ns/op 1.01
fnObj(9) 1.5541 ns/op 1.5767 ns/op 0.99
fnArr(9) 1.5587 ns/op 1.5559 ns/op 1.00
Container {a,b,vec} - as struct x100000 124.61 us/op 125.45 us/op 0.99
Container {a,b,vec} - as tree x100000 528.67 us/op 530.61 us/op 1.00
Container {a,vec,b} - as struct x100000 155.56 us/op 155.65 us/op 1.00
Container {a,vec,b} - as tree x100000 497.57 us/op 499.43 us/op 1.00
get 2 props x1000000 - rawObject 315.80 us/op 311.41 us/op 1.01
get 2 props x1000000 - proxy 73.326 ms/op 74.591 ms/op 0.98
get 2 props x1000000 - customObj 311.49 us/op 312.39 us/op 1.00
Simple object binary -> struct 910.00 ns/op 1.0670 us/op 0.85
Simple object binary -> tree_backed 2.3990 us/op 2.7690 us/op 0.87
Simple object struct -> tree_backed 2.7920 us/op 3.0530 us/op 0.91
Simple object tree_backed -> struct 2.4690 us/op 2.7540 us/op 0.90
Simple object struct -> binary 1.0790 us/op 1.3150 us/op 0.82
Simple object tree_backed -> binary 1.6250 us/op 2.3670 us/op 0.69
aggregationBits binary -> struct 652.00 ns/op 1.0270 us/op 0.63
aggregationBits binary -> tree_backed 2.6270 us/op 3.0870 us/op 0.85
aggregationBits struct -> tree_backed 3.0360 us/op 3.4610 us/op 0.88
aggregationBits tree_backed -> struct 1.2200 us/op 1.3640 us/op 0.89
aggregationBits struct -> binary 816.00 ns/op 927.00 ns/op 0.88
aggregationBits tree_backed -> binary 1.0500 us/op 1.2220 us/op 0.86
List(uint8) 100000 binary -> struct 1.6511 ms/op 1.7589 ms/op 0.94
List(uint8) 100000 binary -> tree_backed 282.66 us/op 327.78 us/op 0.86
List(uint8) 100000 struct -> tree_backed 1.4517 ms/op 1.5219 ms/op 0.95
List(uint8) 100000 tree_backed -> struct 1.2227 ms/op 1.1890 ms/op 1.03
List(uint8) 100000 struct -> binary 1.1020 ms/op 1.1046 ms/op 1.00
List(uint8) 100000 tree_backed -> binary 109.03 us/op 116.18 us/op 0.94
List(uint64Number) 100000 binary -> struct 1.3857 ms/op 1.7489 ms/op 0.79
List(uint64Number) 100000 binary -> tree_backed 4.8135 ms/op 4.5051 ms/op 1.07
List(uint64Number) 100000 struct -> tree_backed 6.5470 ms/op 6.5444 ms/op 1.00
List(uint64Number) 100000 tree_backed -> struct 2.3662 ms/op 2.5559 ms/op 0.93
List(uint64Number) 100000 struct -> binary 1.5673 ms/op 1.7740 ms/op 0.88
List(uint64Number) 100000 tree_backed -> binary 1.0398 ms/op 1.0188 ms/op 1.02
List(Uint64Bigint) 100000 binary -> struct 3.8514 ms/op 4.2970 ms/op 0.90
List(Uint64Bigint) 100000 binary -> tree_backed 5.1880 ms/op 4.8797 ms/op 1.06
List(Uint64Bigint) 100000 struct -> tree_backed 7.5917 ms/op 8.1623 ms/op 0.93
List(Uint64Bigint) 100000 tree_backed -> struct 5.0594 ms/op 5.2988 ms/op 0.95
List(Uint64Bigint) 100000 struct -> binary 2.0717 ms/op 2.0606 ms/op 1.01
List(Uint64Bigint) 100000 tree_backed -> binary 1.1938 ms/op 1.4400 ms/op 0.83
Vector(Root) 100000 binary -> struct 34.905 ms/op 36.707 ms/op 0.95
Vector(Root) 100000 binary -> tree_backed 38.376 ms/op 41.458 ms/op 0.93
Vector(Root) 100000 struct -> tree_backed 51.763 ms/op 52.218 ms/op 0.99
Vector(Root) 100000 tree_backed -> struct 52.323 ms/op 51.186 ms/op 1.02
Vector(Root) 100000 struct -> binary 2.7725 ms/op 2.7851 ms/op 1.00
Vector(Root) 100000 tree_backed -> binary 7.1898 ms/op 6.4095 ms/op 1.12
List(Validator) 100000 binary -> struct 109.95 ms/op 113.11 ms/op 0.97
List(Validator) 100000 binary -> tree_backed 335.11 ms/op 375.70 ms/op 0.89
List(Validator) 100000 struct -> tree_backed 378.41 ms/op 398.81 ms/op 0.95
List(Validator) 100000 tree_backed -> struct 209.76 ms/op 220.41 ms/op 0.95
List(Validator) 100000 struct -> binary 29.963 ms/op 29.494 ms/op 1.02
List(Validator) 100000 tree_backed -> binary 110.63 ms/op 114.34 ms/op 0.97
List(Validator-NS) 100000 binary -> struct 112.88 ms/op 116.85 ms/op 0.97
List(Validator-NS) 100000 binary -> tree_backed 156.56 ms/op 166.01 ms/op 0.94
List(Validator-NS) 100000 struct -> tree_backed 211.86 ms/op 214.46 ms/op 0.99
List(Validator-NS) 100000 tree_backed -> struct 168.64 ms/op 171.25 ms/op 0.98
List(Validator-NS) 100000 struct -> binary 29.031 ms/op 29.019 ms/op 1.00
List(Validator-NS) 100000 tree_backed -> binary 34.808 ms/op 35.573 ms/op 0.98
get epochStatuses - MutableVector 106.28 us/op 112.43 us/op 0.95
get epochStatuses - ViewDU 204.09 us/op 176.88 us/op 1.15
set epochStatuses - ListTreeView 2.1327 ms/op 2.2134 ms/op 0.96
set epochStatuses - ListTreeView - set() 460.52 us/op 463.10 us/op 0.99
set epochStatuses - ListTreeView - commit() 777.25 us/op 795.36 us/op 0.98
bitstring 514.70 ns/op 519.65 ns/op 0.99
bit mask 13.522 ns/op 13.803 ns/op 0.98
struct - increase slot to 1000000 933.31 us/op 933.46 us/op 1.00
UintNumberType - increase slot to 1000000 27.472 ms/op 27.676 ms/op 0.99
UintBigintType - increase slot to 1000000 167.24 ms/op 194.14 ms/op 0.86
UintBigint8 x 100000 tree_deserialize 5.5262 ms/op 6.2549 ms/op 0.88
UintBigint8 x 100000 tree_serialize 1.1619 ms/op 618.30 us/op 1.88
UintBigint16 x 100000 tree_deserialize 5.4219 ms/op 5.5491 ms/op 0.98
UintBigint16 x 100000 tree_serialize 1.3024 ms/op 1.4364 ms/op 0.91
UintBigint32 x 100000 tree_deserialize 6.6669 ms/op 6.9054 ms/op 0.97
UintBigint32 x 100000 tree_serialize 1.8186 ms/op 1.9445 ms/op 0.94
UintBigint64 x 100000 tree_deserialize 7.3299 ms/op 6.7174 ms/op 1.09
UintBigint64 x 100000 tree_serialize 2.4896 ms/op 2.0028 ms/op 1.24
UintBigint8 x 100000 value_deserialize 435.33 us/op 437.02 us/op 1.00
UintBigint8 x 100000 value_serialize 765.16 us/op 826.45 us/op 0.93
UintBigint16 x 100000 value_deserialize 466.45 us/op 466.47 us/op 1.00
UintBigint16 x 100000 value_serialize 806.02 us/op 881.15 us/op 0.91
UintBigint32 x 100000 value_deserialize 497.72 us/op 497.60 us/op 1.00
UintBigint32 x 100000 value_serialize 847.12 us/op 894.44 us/op 0.95
UintBigint64 x 100000 value_deserialize 561.40 us/op 568.83 us/op 0.99
UintBigint64 x 100000 value_serialize 1.0421 ms/op 1.1698 ms/op 0.89
UintBigint8 x 100000 deserialize 3.3859 ms/op 3.7401 ms/op 0.91
UintBigint8 x 100000 serialize 1.5069 ms/op 1.5632 ms/op 0.96
UintBigint16 x 100000 deserialize 3.4329 ms/op 3.8323 ms/op 0.90
UintBigint16 x 100000 serialize 1.5538 ms/op 1.5809 ms/op 0.98
UintBigint32 x 100000 deserialize 3.4487 ms/op 3.8240 ms/op 0.90
UintBigint32 x 100000 serialize 3.1250 ms/op 3.1520 ms/op 0.99
UintBigint64 x 100000 deserialize 4.1473 ms/op 4.3514 ms/op 0.95
UintBigint64 x 100000 serialize 1.6488 ms/op 1.7051 ms/op 0.97
UintBigint128 x 100000 deserialize 5.7798 ms/op 6.5214 ms/op 0.89
UintBigint128 x 100000 serialize 14.633 ms/op 15.040 ms/op 0.97
UintBigint256 x 100000 deserialize 8.8361 ms/op 8.7719 ms/op 1.01
UintBigint256 x 100000 serialize 43.044 ms/op 43.780 ms/op 0.98
Slice from Uint8Array x25000 1.4704 ms/op 1.3705 ms/op 1.07
Slice from ArrayBuffer x25000 16.309 ms/op 17.271 ms/op 0.94
Slice from ArrayBuffer x25000 + new Uint8Array 17.896 ms/op 18.737 ms/op 0.96
Copy Uint8Array 100000 iterate 2.7418 ms/op 2.6751 ms/op 1.02
Copy Uint8Array 100000 slice 100.92 us/op 119.06 us/op 0.85
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 98.822 us/op 117.54 us/op 0.84
Copy Buffer 100000 Uint8Array.prototype.slice.call 98.559 us/op 117.13 us/op 0.84
Copy Uint8Array 100000 slice + set 203.24 us/op 248.93 us/op 0.82
Copy Uint8Array 100000 subarray + set 100.64 us/op 116.06 us/op 0.87
Copy Uint8Array 100000 slice arrayBuffer 98.199 us/op 118.19 us/op 0.83
Uint64 deserialize 100000 - iterate Uint8Array 1.9441 ms/op 2.1325 ms/op 0.91
Uint64 deserialize 100000 - by Uint32A 1.9442 ms/op 2.1143 ms/op 0.92
Uint64 deserialize 100000 - by DataView.getUint32 x2 2.0185 ms/op 2.0969 ms/op 0.96
Uint64 deserialize 100000 - by DataView.getBigUint64 4.9336 ms/op 5.3011 ms/op 0.93
Uint64 deserialize 100000 - by byte 40.949 ms/op 40.573 ms/op 1.01

by benchmarkbot/action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants