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

fix: update the hasher for benchmarks #437

Merged
merged 1 commit into from
Jan 15, 2025
Merged

Conversation

nazarhussain
Copy link
Contributor

@nazarhussain nazarhussain commented Jan 15, 2025

Motivation

Use the hashtree hasher for the benchmarks.

Description

Steps to test or reproduce

  • Run all tests

Reference

https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-main-and-types

@nazarhussain nazarhussain requested a review from a team as a code owner January 15, 2025 16:24
Copy link

Performance Report

✔️ no performance regression detected

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 9fa6e8d Previous: 9729005 Ratio
cachePermanentRootStruct no cache 5.8030 us/op 22.908 us/op 0.25
BeaconState ViewDU hashTreeRoot() vc=200000 116.46 ms/op 607.13 ms/op 0.19
BeaconState ViewDU batchHashTreeRoot vc=200000 105.70 ms/op 452.39 ms/op 0.23
BeaconState ViewDU hashTreeRoot - commit step vc=200000 93.480 ms/op 385.07 ms/op 0.24
BeaconState ViewDU hashTreeRoot - hash step vc=200000 18.347 ms/op 75.611 ms/op 0.24
hashTreeRoot Attestation - struct 22.876 us/op 104.67 us/op 0.22
hashTreeRoot Attestation - tree 9.5350 us/op 102.55 us/op 0.09
hashTreeRoot SignedAggregateAndProof - struct 30.758 us/op 129.70 us/op 0.24
hashTreeRoot SignedAggregateAndProof - tree 14.267 us/op 128.79 us/op 0.11
hashTreeRoot SyncCommitteeMessage - struct 7.9980 us/op 28.707 us/op 0.28
hashTreeRoot SyncCommitteeMessage - tree 3.4860 us/op 29.674 us/op 0.12
hashTreeRoot SignedContributionAndProof - struct 19.478 us/op 71.347 us/op 0.27
hashTreeRoot SignedContributionAndProof - tree 9.8680 us/op 72.691 us/op 0.14
hashTreeRoot SignedBeaconBlock - struct 1.6926 ms/op 5.9763 ms/op 0.28
hashTreeRoot SignedBeaconBlock - tree 864.17 us/op 6.5414 ms/op 0.13
hashTreeRoot Validator - tree 8.4790 us/op 33.009 us/op 0.26
BeaconState vc 300000 - hashTreeRoot tree 2.4452 s/op 12.242 s/op 0.20
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 1.2120 us/op 5.0680 us/op 0.24
BeaconState.validators vc 300000 - hashTreeRoot tree 2.6535 s/op 11.852 s/op 0.22
BeaconState.balances vc 300000 - hashTreeRoot tree 36.744 ms/op 327.10 ms/op 0.11
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 4.5193 ms/op 39.560 ms/op 0.11
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 4.5081 ms/op 37.782 ms/op 0.12
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 36.886 ms/op 320.59 ms/op 0.12
hash64 x18 9.5290 us/op 47.150 us/op 0.20
hashTwoObjects x18 8.5130 us/op 67.919 us/op 0.13
hash64 x1740 910.56 us/op 5.2261 ms/op 0.17
hashTwoObjects x1740 788.23 us/op 6.8619 ms/op 0.11
hash64 x2700000 1.3920 s/op 7.4652 s/op 0.19
hashTwoObjects x2700000 1.2197 s/op 10.620 s/op 0.11
set_exitEpoch_and_hashTreeRoot - ContainerType 3.2640 us/op 11.978 us/op 0.27
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 7.9740 us/op 30.528 us/op 0.26
Full benchmark results
Benchmark suite Current: 9fa6e8d Previous: 9729005 Ratio
digestTwoHashObjects 50023 times 48.481 ms/op 48.723 ms/op 1.00
digest2Bytes32 50023 times 54.816 ms/op 55.394 ms/op 0.99
digest 50023 times 56.884 ms/op 56.560 ms/op 1.01
input length 32 1.2610 us/op 1.2260 us/op 1.03
input length 64 1.3620 us/op 1.3510 us/op 1.01
input length 128 2.3520 us/op 2.2710 us/op 1.04
input length 256 3.5110 us/op 3.3900 us/op 1.04
input length 512 5.7790 us/op 5.6380 us/op 1.03
input length 1024 11.302 us/op 11.023 us/op 1.03
digest 1000000 times 929.53 ms/op 862.38 ms/op 1.08
hashObjectToByteArray 50023 times 1.2300 ms/op 1.2407 ms/op 0.99
byteArrayToHashObject 50023 times 1.8384 ms/op 1.7831 ms/op 1.03
digest64 200092 times 225.70 ms/op 216.88 ms/op 1.04
hash 200092 times using batchHash4UintArray64s 249.82 ms/op 239.05 ms/op 1.05
digest64HashObjects 200092 times 197.33 ms/op 194.75 ms/op 1.01
hash 200092 times using batchHash4HashObjectInputs 216.69 ms/op 204.61 ms/op 1.06
getGindicesAtDepth 4.3050 us/op 4.2100 us/op 1.02
iterateAtDepth 7.6350 us/op 7.6110 us/op 1.00
getGindexBits 463.00 ns/op 433.00 ns/op 1.07
gindexIterator 1.0420 us/op 1.0200 us/op 1.02
HashComputationLevel.push then loop 29.727 ms/op 27.644 ms/op 1.08
HashComputation[] push then loop 50.536 ms/op 48.288 ms/op 1.05
hash 2 Uint8Array 500000 times - hashtree 221.19 ms/op 216.16 ms/op 1.02
hashTwoObjects 500000 times - hashtree 210.67 ms/op 213.96 ms/op 0.98
executeHashComputations - hashtree 10.479 ms/op 9.4486 ms/op 1.11
hash 2 Uint8Array 500000 times - as-sha256 565.96 ms/op 566.64 ms/op 1.00
hashTwoObjects 500000 times - as-sha256 508.44 ms/op 508.63 ms/op 1.00
executeHashComputations - as-sha256 48.067 ms/op 46.578 ms/op 1.03
hash 2 Uint8Array 500000 times - noble 1.2851 s/op 1.2332 s/op 1.04
hashTwoObjects 500000 times - noble 1.8595 s/op 1.6503 s/op 1.13
executeHashComputations - noble 40.755 ms/op 36.437 ms/op 1.12
getHashComputations 2.9432 ms/op 2.1577 ms/op 1.36
executeHashComputations 12.604 ms/op 9.3634 ms/op 1.35
get root 16.322 ms/op 15.278 ms/op 1.07
getNodeH() x7812.5 avg hindex 13.089 us/op 12.451 us/op 1.05
getNodeH() x7812.5 index 0 7.4920 us/op 7.5590 us/op 0.99
getNodeH() x7812.5 index 7 7.6060 us/op 7.6090 us/op 1.00
getNodeH() x7812.5 index 7 with key array 6.3030 us/op 6.4250 us/op 0.98
new LeafNode() x7812.5 303.61 us/op 313.76 us/op 0.97
getHashComputations 250000 nodes 17.036 ms/op 14.571 ms/op 1.17
batchHash 250000 nodes 89.062 ms/op 94.878 ms/op 0.94
get root 250000 nodes 115.49 ms/op 115.60 ms/op 1.00
getHashComputations 500000 nodes 28.540 ms/op 28.957 ms/op 0.99
batchHash 500000 nodes 163.93 ms/op 170.01 ms/op 0.96
get root 500000 nodes 238.63 ms/op 241.38 ms/op 0.99
getHashComputations 1000000 nodes 68.809 ms/op 60.808 ms/op 1.13
batchHash 1000000 nodes 321.56 ms/op 335.20 ms/op 0.96
get root 1000000 nodes 458.56 ms/op 461.65 ms/op 0.99
multiproof - depth 15, 1 requested leaves 9.4010 us/op 9.6620 us/op 0.97
tree offset multiproof - depth 15, 1 requested leaves 20.892 us/op 21.144 us/op 0.99
compact multiproof - depth 15, 1 requested leaves 3.8100 us/op 3.8480 us/op 0.99
multiproof - depth 15, 2 requested leaves 14.068 us/op 13.805 us/op 1.02
tree offset multiproof - depth 15, 2 requested leaves 25.121 us/op 24.103 us/op 1.04
compact multiproof - depth 15, 2 requested leaves 3.9790 us/op 3.3080 us/op 1.20
multiproof - depth 15, 3 requested leaves 19.439 us/op 18.412 us/op 1.06
tree offset multiproof - depth 15, 3 requested leaves 32.568 us/op 31.255 us/op 1.04
compact multiproof - depth 15, 3 requested leaves 5.5080 us/op 5.5770 us/op 0.99
multiproof - depth 15, 4 requested leaves 25.597 us/op 26.241 us/op 0.98
tree offset multiproof - depth 15, 4 requested leaves 41.123 us/op 39.953 us/op 1.03
compact multiproof - depth 15, 4 requested leaves 7.1320 us/op 6.8160 us/op 1.05
packedRootsBytesToLeafNodes bytes 4000 offset 0 7.6680 us/op 7.4460 us/op 1.03
packedRootsBytesToLeafNodes bytes 4000 offset 1 7.5230 us/op 6.7430 us/op 1.12
packedRootsBytesToLeafNodes bytes 4000 offset 2 7.0750 us/op 7.1000 us/op 1.00
packedRootsBytesToLeafNodes bytes 4000 offset 3 6.8420 us/op 7.4620 us/op 0.92
subtreeFillToContents depth 40 count 250000 53.767 ms/op 53.556 ms/op 1.00
setRoot - gindexBitstring 27.049 ms/op 22.368 ms/op 1.21
setRoot - gindex 25.405 ms/op 23.427 ms/op 1.08
getRoot - gindexBitstring 2.8274 ms/op 2.7928 ms/op 1.01
getRoot - gindex 3.7545 ms/op 3.7569 ms/op 1.00
getHashObject then setHashObject 27.348 ms/op 25.188 ms/op 1.09
setNodeWithFn 25.226 ms/op 21.170 ms/op 1.19
getNodeAtDepth depth 0 x100000 280.25 us/op 280.05 us/op 1.00
setNodeAtDepth depth 0 x100000 2.7730 ms/op 2.7835 ms/op 1.00
getNodesAtDepth depth 0 x100000 312.41 us/op 315.40 us/op 0.99
setNodesAtDepth depth 0 x100000 772.27 us/op 803.12 us/op 0.96
getNodeAtDepth depth 1 x100000 342.16 us/op 342.31 us/op 1.00
setNodeAtDepth depth 1 x100000 11.144 ms/op 11.392 ms/op 0.98
getNodesAtDepth depth 1 x100000 435.80 us/op 436.81 us/op 1.00
setNodesAtDepth depth 1 x100000 7.4337 ms/op 8.5412 ms/op 0.87
getNodeAtDepth depth 2 x100000 734.94 us/op 748.19 us/op 0.98
setNodeAtDepth depth 2 x100000 18.250 ms/op 21.655 ms/op 0.84
getNodesAtDepth depth 2 x100000 19.679 ms/op 21.755 ms/op 0.90
setNodesAtDepth depth 2 x100000 24.857 ms/op 29.813 ms/op 0.83
tree.getNodesAtDepth - gindexes 9.8908 ms/op 9.4571 ms/op 1.05
tree.getNodesAtDepth - push all nodes 2.5227 ms/op 3.6860 ms/op 0.68
tree.getNodesAtDepth - navigation 311.17 us/op 311.66 us/op 1.00
tree.setNodesAtDepth - indexes 841.16 us/op 870.84 us/op 0.97
set at depth 8 933.00 ns/op 990.00 ns/op 0.94
set at depth 16 1.2880 us/op 1.4980 us/op 0.86
set at depth 32 2.2230 us/op 2.6160 us/op 0.85
iterateNodesAtDepth 8 256 15.155 us/op 16.140 us/op 0.94
getNodesAtDepth 8 256 4.0860 us/op 4.0760 us/op 1.00
iterateNodesAtDepth 16 65536 4.9400 ms/op 4.6957 ms/op 1.05
getNodesAtDepth 16 65536 2.0207 ms/op 1.9329 ms/op 1.05
iterateNodesAtDepth 32 250000 16.992 ms/op 17.065 ms/op 1.00
getNodesAtDepth 32 250000 5.6741 ms/op 5.5690 ms/op 1.02
iterateNodesAtDepth 40 250000 17.438 ms/op 17.518 ms/op 1.00
getNodesAtDepth 40 250000 5.5336 ms/op 6.3452 ms/op 0.87
250000 validators root getter 116.76 ms/op 116.82 ms/op 1.00
250000 validators batchHash() 117.58 ms/op 146.04 ms/op 0.81
250000 validators hashComputations 15.397 ms/op 17.985 ms/op 0.86
bitlist bytes to struct (120,90) 798.00 ns/op 1.4790 us/op 0.54
bitlist bytes to tree (120,90) 3.1990 us/op 5.0730 us/op 0.63
bitlist bytes to struct (2048,2048) 1.1920 us/op 1.8910 us/op 0.63
bitlist bytes to tree (2048,2048) 4.2770 us/op 7.9650 us/op 0.54
ByteListType - deserialize 8.5429 ms/op 12.550 ms/op 0.68
BasicListType - deserialize 15.042 ms/op 18.072 ms/op 0.83
ByteListType - serialize 8.9173 ms/op 12.530 ms/op 0.71
BasicListType - serialize 11.059 ms/op 16.236 ms/op 0.68
BasicListType - tree_convertToStruct 27.349 ms/op 57.248 ms/op 0.48
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 5.1207 ms/op 5.5862 ms/op 0.92
List[uint8, 68719476736] len 300000 ViewDU.get(i) 4.2421 ms/op 4.3393 ms/op 0.98
Array.push len 300000 empty Array - number 7.2579 ms/op 7.2888 ms/op 1.00
Array.set len 300000 from new Array - number 1.7639 ms/op 2.2772 ms/op 0.77
Array.set len 300000 - number 6.0560 ms/op 7.2350 ms/op 0.84
Uint8Array.set len 300000 494.11 us/op 507.46 us/op 0.97
Uint32Array.set len 300000 571.13 us/op 633.01 us/op 0.90
Container({a: uint8, b: uint8}) getViewDU x300000 26.000 ms/op 30.436 ms/op 0.85
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 11.269 ms/op 11.494 ms/op 0.98
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 224.34 ms/op 217.11 ms/op 1.03
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 251.25 ms/op 265.71 ms/op 0.95
List(Container) len 300000 ViewDU.get(i) 7.5077 ms/op 7.1066 ms/op 1.06
List(Container) len 300000 ViewDU.getReadonly(i) 7.4028 ms/op 8.9971 ms/op 0.82
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 35.470 ms/op 38.920 ms/op 0.91
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 6.4621 ms/op 6.0683 ms/op 1.06
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 6.6332 ms/op 6.5574 ms/op 1.01
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 6.5951 ms/op 7.1471 ms/op 0.92
Array.push len 300000 empty Array - object 7.8678 ms/op 7.0016 ms/op 1.12
Array.set len 300000 from new Array - object 2.2077 ms/op 2.1312 ms/op 1.04
Array.set len 300000 - object 6.4950 ms/op 6.8305 ms/op 0.95
cachePermanentRootStruct no cache 5.8030 us/op 22.908 us/op 0.25
cachePermanentRootStruct with cache 255.00 ns/op 272.00 ns/op 0.94
epochParticipation len 250000 rws 7813 2.3770 ms/op 2.5209 ms/op 0.94
BeaconState ViewDU hashTreeRoot() vc=200000 116.46 ms/op 607.13 ms/op 0.19
BeaconState ViewDU recursive hash - commit step vc=200000 5.3995 ms/op 4.9146 ms/op 1.10
BeaconState ViewDU validator tree creation vc=10000 41.488 ms/op 40.470 ms/op 1.03
BeaconState ViewDU batchHashTreeRoot vc=200000 105.70 ms/op 452.39 ms/op 0.23
BeaconState ViewDU hashTreeRoot - commit step vc=200000 93.480 ms/op 385.07 ms/op 0.24
BeaconState ViewDU hashTreeRoot - hash step vc=200000 18.347 ms/op 75.611 ms/op 0.24
deserialize Attestation - tree 3.9360 us/op 4.4960 us/op 0.88
deserialize Attestation - struct 2.0850 us/op 2.3260 us/op 0.90
deserialize SignedAggregateAndProof - tree 5.3380 us/op 6.2550 us/op 0.85
deserialize SignedAggregateAndProof - struct 3.4170 us/op 4.1660 us/op 0.82
deserialize SyncCommitteeMessage - tree 1.5490 us/op 1.5990 us/op 0.97
deserialize SyncCommitteeMessage - struct 1.2730 us/op 1.4270 us/op 0.89
deserialize SignedContributionAndProof - tree 3.3080 us/op 3.4450 us/op 0.96
deserialize SignedContributionAndProof - struct 2.8160 us/op 3.0600 us/op 0.92
deserialize SignedBeaconBlock - tree 303.39 us/op 360.53 us/op 0.84
deserialize SignedBeaconBlock - struct 134.14 us/op 154.04 us/op 0.87
BeaconState vc 300000 - deserialize tree 662.04 ms/op 673.94 ms/op 0.98
BeaconState vc 300000 - serialize tree 148.42 ms/op 138.13 ms/op 1.07
BeaconState.historicalRoots vc 300000 - deserialize tree 942.00 ns/op 891.00 ns/op 1.06
BeaconState.historicalRoots vc 300000 - serialize tree 787.00 ns/op 751.00 ns/op 1.05
BeaconState.validators vc 300000 - deserialize tree 640.70 ms/op 626.86 ms/op 1.02
BeaconState.validators vc 300000 - serialize tree 109.92 ms/op 116.44 ms/op 0.94
BeaconState.balances vc 300000 - deserialize tree 30.416 ms/op 28.058 ms/op 1.08
BeaconState.balances vc 300000 - serialize tree 4.9703 ms/op 5.1586 ms/op 0.96
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 1.0969 ms/op 1.2471 ms/op 0.88
BeaconState.previousEpochParticipation vc 300000 - serialize tree 330.96 us/op 348.21 us/op 0.95
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 1.1091 ms/op 1.2675 ms/op 0.88
BeaconState.currentEpochParticipation vc 300000 - serialize tree 328.68 us/op 343.11 us/op 0.96
BeaconState.inactivityScores vc 300000 - deserialize tree 27.878 ms/op 29.254 ms/op 0.95
BeaconState.inactivityScores vc 300000 - serialize tree 6.4021 ms/op 7.9771 ms/op 0.80
hashTreeRoot Attestation - struct 22.876 us/op 104.67 us/op 0.22
hashTreeRoot Attestation - tree 9.5350 us/op 102.55 us/op 0.09
hashTreeRoot SignedAggregateAndProof - struct 30.758 us/op 129.70 us/op 0.24
hashTreeRoot SignedAggregateAndProof - tree 14.267 us/op 128.79 us/op 0.11
hashTreeRoot SyncCommitteeMessage - struct 7.9980 us/op 28.707 us/op 0.28
hashTreeRoot SyncCommitteeMessage - tree 3.4860 us/op 29.674 us/op 0.12
hashTreeRoot SignedContributionAndProof - struct 19.478 us/op 71.347 us/op 0.27
hashTreeRoot SignedContributionAndProof - tree 9.8680 us/op 72.691 us/op 0.14
hashTreeRoot SignedBeaconBlock - struct 1.6926 ms/op 5.9763 ms/op 0.28
hashTreeRoot SignedBeaconBlock - tree 864.17 us/op 6.5414 ms/op 0.13
hashTreeRoot Validator - struct 10.002 us/op 28.452 us/op 0.35
hashTreeRoot Validator - tree 8.4790 us/op 33.009 us/op 0.26
BeaconState vc 300000 - hashTreeRoot tree 2.4452 s/op 12.242 s/op 0.20
BeaconState vc 300000 - batchHashTreeRoot tree 4.2413 s/op 6.6136 s/op 0.64
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 1.2120 us/op 5.0680 us/op 0.24
BeaconState.validators vc 300000 - hashTreeRoot tree 2.6535 s/op 11.852 s/op 0.22
BeaconState.balances vc 300000 - hashTreeRoot tree 36.744 ms/op 327.10 ms/op 0.11
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 4.5193 ms/op 39.560 ms/op 0.11
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 4.5081 ms/op 37.782 ms/op 0.12
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 36.886 ms/op 320.59 ms/op 0.12
hash64 x18 9.5290 us/op 47.150 us/op 0.20
hashTwoObjects x18 8.5130 us/op 67.919 us/op 0.13
hash64 x1740 910.56 us/op 5.2261 ms/op 0.17
hashTwoObjects x1740 788.23 us/op 6.8619 ms/op 0.11
hash64 x2700000 1.3920 s/op 7.4652 s/op 0.19
hashTwoObjects x2700000 1.2197 s/op 10.620 s/op 0.11
get_exitEpoch - ContainerType 321.00 ns/op 302.00 ns/op 1.06
get_exitEpoch - ContainerNodeStructType 331.00 ns/op 268.00 ns/op 1.24
set_exitEpoch - ContainerType 346.00 ns/op 287.00 ns/op 1.21
set_exitEpoch - ContainerNodeStructType 329.00 ns/op 276.00 ns/op 1.19
get_pubkey - ContainerType 1.2430 us/op 1.0040 us/op 1.24
get_pubkey - ContainerNodeStructType 316.00 ns/op 260.00 ns/op 1.22
hashTreeRoot - ContainerType 580.00 ns/op 472.00 ns/op 1.23
hashTreeRoot - ContainerNodeStructType 549.00 ns/op 459.00 ns/op 1.20
createProof - ContainerType 5.1100 us/op 4.2970 us/op 1.19
createProof - ContainerNodeStructType 26.761 us/op 21.579 us/op 1.24
serialize - ContainerType 1.9930 us/op 1.5720 us/op 1.27
serialize - ContainerNodeStructType 1.6780 us/op 1.3410 us/op 1.25
set_exitEpoch_and_hashTreeRoot - ContainerType 3.2640 us/op 11.978 us/op 0.27
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 7.9740 us/op 30.528 us/op 0.26
Array - for of 5.8090 us/op 5.6250 us/op 1.03
Array - for(;;) 5.6130 us/op 5.5830 us/op 1.01
basicListValue.readonlyValuesArray() 5.3272 ms/op 3.8673 ms/op 1.38
basicListValue.readonlyValuesArray() + loop all 5.1121 ms/op 4.2037 ms/op 1.22
compositeListValue.readonlyValuesArray() 31.694 ms/op 37.810 ms/op 0.84
compositeListValue.readonlyValuesArray() + loop all 32.314 ms/op 37.015 ms/op 0.87
Number64UintType - get balances list 5.2371 ms/op 4.2271 ms/op 1.24
Number64UintType - set balances list 10.341 ms/op 9.8431 ms/op 1.05
Number64UintType - get and increase 10 then set 43.459 ms/op 39.999 ms/op 1.09
Number64UintType - increase 10 using applyDelta 17.645 ms/op 14.608 ms/op 1.21
Number64UintType - increase 10 using applyDeltaInBatch 17.539 ms/op 14.305 ms/op 1.23
tree_newTreeFromUint64Deltas 23.070 ms/op 25.776 ms/op 0.90
unsafeUint8ArrayToTree 41.216 ms/op 47.853 ms/op 0.86
bitLength(50) 289.00 ns/op 219.00 ns/op 1.32
bitLengthStr(50) 256.00 ns/op 215.00 ns/op 1.19
bitLength(8000) 281.00 ns/op 211.00 ns/op 1.33
bitLengthStr(8000) 294.00 ns/op 268.00 ns/op 1.10
bitLength(250000) 279.00 ns/op 235.00 ns/op 1.19
bitLengthStr(250000) 327.00 ns/op 299.00 ns/op 1.09
floor - Math.floor (53) 1.2432 ns/op 1.2457 ns/op 1.00
floor - << 0 (53) 1.2434 ns/op 1.2429 ns/op 1.00
floor - Math.floor (512) 1.2450 ns/op 1.2434 ns/op 1.00
floor - << 0 (512) 1.2466 ns/op 1.2447 ns/op 1.00
fnIf(0) 1.5537 ns/op 1.5761 ns/op 0.99
fnSwitch(0) 2.1852 ns/op 2.1782 ns/op 1.00
fnObj(0) 1.5878 ns/op 1.5579 ns/op 1.02
fnArr(0) 1.5531 ns/op 1.5560 ns/op 1.00
fnIf(4) 2.1792 ns/op 2.1771 ns/op 1.00
fnSwitch(4) 2.1798 ns/op 2.1989 ns/op 0.99
fnObj(4) 1.5622 ns/op 1.5690 ns/op 1.00
fnArr(4) 1.5540 ns/op 1.5552 ns/op 1.00
fnIf(9) 3.1165 ns/op 3.1073 ns/op 1.00
fnSwitch(9) 2.1792 ns/op 2.2121 ns/op 0.99
fnObj(9) 1.5571 ns/op 1.5765 ns/op 0.99
fnArr(9) 1.5810 ns/op 1.5541 ns/op 1.02
Container {a,b,vec} - as struct x100000 124.56 us/op 124.55 us/op 1.00
Container {a,b,vec} - as tree x100000 529.95 us/op 528.92 us/op 1.00
Container {a,vec,b} - as struct x100000 155.65 us/op 156.44 us/op 1.00
Container {a,vec,b} - as tree x100000 498.19 us/op 505.99 us/op 0.98
get 2 props x1000000 - rawObject 311.80 us/op 316.13 us/op 0.99
get 2 props x1000000 - proxy 73.435 ms/op 73.091 ms/op 1.00
get 2 props x1000000 - customObj 311.30 us/op 313.76 us/op 0.99
Simple object binary -> struct 1.0150 us/op 759.00 ns/op 1.34
Simple object binary -> tree_backed 2.6720 us/op 1.9970 us/op 1.34
Simple object struct -> tree_backed 2.9360 us/op 2.4020 us/op 1.22
Simple object tree_backed -> struct 2.6790 us/op 1.9420 us/op 1.38
Simple object struct -> binary 1.0700 us/op 1.0490 us/op 1.02
Simple object tree_backed -> binary 1.9300 us/op 1.6550 us/op 1.17
aggregationBits binary -> struct 700.00 ns/op 560.00 ns/op 1.25
aggregationBits binary -> tree_backed 2.9750 us/op 2.2930 us/op 1.30
aggregationBits struct -> tree_backed 3.4310 us/op 2.6710 us/op 1.28
aggregationBits tree_backed -> struct 1.3770 us/op 1.0470 us/op 1.32
aggregationBits struct -> binary 917.00 ns/op 741.00 ns/op 1.24
aggregationBits tree_backed -> binary 1.2510 us/op 914.00 ns/op 1.37
List(uint8) 100000 binary -> struct 1.9404 ms/op 1.3779 ms/op 1.41
List(uint8) 100000 binary -> tree_backed 346.62 us/op 256.83 us/op 1.35
List(uint8) 100000 struct -> tree_backed 1.4833 ms/op 1.3839 ms/op 1.07
List(uint8) 100000 tree_backed -> struct 1.2187 ms/op 1.0863 ms/op 1.12
List(uint8) 100000 struct -> binary 1.1229 ms/op 1.1218 ms/op 1.00
List(uint8) 100000 tree_backed -> binary 107.96 us/op 105.70 us/op 1.02
List(uint64Number) 100000 binary -> struct 1.4176 ms/op 1.3448 ms/op 1.05
List(uint64Number) 100000 binary -> tree_backed 4.8895 ms/op 5.8729 ms/op 0.83
List(uint64Number) 100000 struct -> tree_backed 6.3598 ms/op 7.2042 ms/op 0.88
List(uint64Number) 100000 tree_backed -> struct 2.9329 ms/op 2.2653 ms/op 1.29
List(uint64Number) 100000 struct -> binary 1.7238 ms/op 1.4722 ms/op 1.17
List(uint64Number) 100000 tree_backed -> binary 1.6856 ms/op 932.94 us/op 1.81
List(Uint64Bigint) 100000 binary -> struct 4.6012 ms/op 3.4927 ms/op 1.32
List(Uint64Bigint) 100000 binary -> tree_backed 4.8195 ms/op 5.8235 ms/op 0.83
List(Uint64Bigint) 100000 struct -> tree_backed 7.0511 ms/op 7.7612 ms/op 0.91
List(Uint64Bigint) 100000 tree_backed -> struct 5.7146 ms/op 4.6106 ms/op 1.24
List(Uint64Bigint) 100000 struct -> binary 2.1568 ms/op 2.0197 ms/op 1.07
List(Uint64Bigint) 100000 tree_backed -> binary 1.6902 ms/op 1.0360 ms/op 1.63
Vector(Root) 100000 binary -> struct 38.255 ms/op 41.299 ms/op 0.93
Vector(Root) 100000 binary -> tree_backed 43.453 ms/op 47.512 ms/op 0.91
Vector(Root) 100000 struct -> tree_backed 55.164 ms/op 51.427 ms/op 1.07
Vector(Root) 100000 tree_backed -> struct 53.763 ms/op 53.558 ms/op 1.00
Vector(Root) 100000 struct -> binary 2.9031 ms/op 2.6961 ms/op 1.08
Vector(Root) 100000 tree_backed -> binary 7.1659 ms/op 7.2609 ms/op 0.99
List(Validator) 100000 binary -> struct 105.19 ms/op 136.12 ms/op 0.77
List(Validator) 100000 binary -> tree_backed 383.11 ms/op 425.62 ms/op 0.90
List(Validator) 100000 struct -> tree_backed 407.93 ms/op 450.92 ms/op 0.90
List(Validator) 100000 tree_backed -> struct 227.15 ms/op 211.98 ms/op 1.07
List(Validator) 100000 struct -> binary 29.876 ms/op 30.363 ms/op 0.98
List(Validator) 100000 tree_backed -> binary 109.26 ms/op 100.07 ms/op 1.09
List(Validator-NS) 100000 binary -> struct 129.00 ms/op 147.59 ms/op 0.87
List(Validator-NS) 100000 binary -> tree_backed 181.12 ms/op 200.66 ms/op 0.90
List(Validator-NS) 100000 struct -> tree_backed 229.92 ms/op 234.93 ms/op 0.98
List(Validator-NS) 100000 tree_backed -> struct 186.02 ms/op 182.55 ms/op 1.02
List(Validator-NS) 100000 struct -> binary 30.402 ms/op 29.408 ms/op 1.03
List(Validator-NS) 100000 tree_backed -> binary 36.973 ms/op 34.470 ms/op 1.07
get epochStatuses - MutableVector 116.46 us/op 90.560 us/op 1.29
get epochStatuses - ViewDU 209.43 us/op 176.41 us/op 1.19
set epochStatuses - ListTreeView 2.3586 ms/op 2.1192 ms/op 1.11
set epochStatuses - ListTreeView - set() 446.64 us/op 600.25 us/op 0.74
set epochStatuses - ListTreeView - commit() 809.37 us/op 737.69 us/op 1.10
bitstring 520.47 ns/op 516.25 ns/op 1.01
bit mask 14.100 ns/op 13.696 ns/op 1.03
struct - increase slot to 1000000 933.62 us/op 936.93 us/op 1.00
UintNumberType - increase slot to 1000000 26.787 ms/op 26.797 ms/op 1.00
UintBigintType - increase slot to 1000000 215.35 ms/op 170.00 ms/op 1.27
UintBigint8 x 100000 tree_deserialize 6.2975 ms/op 6.0449 ms/op 1.04
UintBigint8 x 100000 tree_serialize 1.1064 ms/op 621.58 us/op 1.78
UintBigint16 x 100000 tree_deserialize 6.6508 ms/op 6.1507 ms/op 1.08
UintBigint16 x 100000 tree_serialize 1.6408 ms/op 1.3845 ms/op 1.19
UintBigint32 x 100000 tree_deserialize 6.8601 ms/op 6.2660 ms/op 1.09
UintBigint32 x 100000 tree_serialize 2.2888 ms/op 1.7748 ms/op 1.29
UintBigint64 x 100000 tree_deserialize 7.7478 ms/op 7.2982 ms/op 1.06
UintBigint64 x 100000 tree_serialize 2.9918 ms/op 1.9973 ms/op 1.50
UintBigint8 x 100000 value_deserialize 435.62 us/op 435.89 us/op 1.00
UintBigint8 x 100000 value_serialize 1.0249 ms/op 793.84 us/op 1.29
UintBigint16 x 100000 value_deserialize 466.49 us/op 473.52 us/op 0.99
UintBigint16 x 100000 value_serialize 1.0635 ms/op 990.50 us/op 1.07
UintBigint32 x 100000 value_deserialize 497.46 us/op 499.28 us/op 1.00
UintBigint32 x 100000 value_serialize 1.0547 ms/op 1.0057 ms/op 1.05
UintBigint64 x 100000 value_deserialize 570.90 us/op 562.37 us/op 1.02
UintBigint64 x 100000 value_serialize 1.3517 ms/op 1.1979 ms/op 1.13
UintBigint8 x 100000 deserialize 4.1360 ms/op 3.7272 ms/op 1.11
UintBigint8 x 100000 serialize 1.5725 ms/op 1.6159 ms/op 0.97
UintBigint16 x 100000 deserialize 4.2926 ms/op 3.8259 ms/op 1.12
UintBigint16 x 100000 serialize 1.6453 ms/op 1.6560 ms/op 0.99
UintBigint32 x 100000 deserialize 4.2470 ms/op 3.6586 ms/op 1.16
UintBigint32 x 100000 serialize 3.1879 ms/op 2.8436 ms/op 1.12
UintBigint64 x 100000 deserialize 4.6308 ms/op 4.4573 ms/op 1.04
UintBigint64 x 100000 serialize 1.6362 ms/op 1.6010 ms/op 1.02
UintBigint128 x 100000 deserialize 5.7614 ms/op 5.1677 ms/op 1.11
UintBigint128 x 100000 serialize 14.982 ms/op 14.722 ms/op 1.02
UintBigint256 x 100000 deserialize 9.2682 ms/op 8.2073 ms/op 1.13
UintBigint256 x 100000 serialize 43.778 ms/op 43.597 ms/op 1.00
Slice from Uint8Array x25000 1.4558 ms/op 1.2243 ms/op 1.19
Slice from ArrayBuffer x25000 16.735 ms/op 15.745 ms/op 1.06
Slice from ArrayBuffer x25000 + new Uint8Array 18.185 ms/op 16.770 ms/op 1.08
Copy Uint8Array 100000 iterate 2.6599 ms/op 2.6402 ms/op 1.01
Copy Uint8Array 100000 slice 134.11 us/op 81.572 us/op 1.64
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 127.67 us/op 81.066 us/op 1.57
Copy Buffer 100000 Uint8Array.prototype.slice.call 124.47 us/op 84.348 us/op 1.48
Copy Uint8Array 100000 slice + set 259.57 us/op 166.03 us/op 1.56
Copy Uint8Array 100000 subarray + set 129.79 us/op 80.875 us/op 1.60
Copy Uint8Array 100000 slice arrayBuffer 132.68 us/op 80.575 us/op 1.65
Uint64 deserialize 100000 - iterate Uint8Array 2.1023 ms/op 1.8646 ms/op 1.13
Uint64 deserialize 100000 - by Uint32A 2.1332 ms/op 1.9865 ms/op 1.07
Uint64 deserialize 100000 - by DataView.getUint32 x2 2.1538 ms/op 1.8521 ms/op 1.16
Uint64 deserialize 100000 - by DataView.getBigUint64 5.3826 ms/op 4.8557 ms/op 1.11
Uint64 deserialize 100000 - by byte 40.849 ms/op 40.845 ms/op 1.00

by benchmarkbot/action

@wemeetagain wemeetagain merged commit bd1bf71 into master Jan 15, 2025
9 checks passed
@wemeetagain wemeetagain deleted the nh/fix-hahser-benchmark branch January 15, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants