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!: use named exports to expose different hashers #459

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

nazarhussain
Copy link
Contributor

Motivation

Allow users to easily choose the hasher.

Description

  • Use named exports for different hashers
  • Limit users to not load build directories directly

Steps to test or reproduce

Run all tests

@nazarhussain nazarhussain requested a review from a team as a code owner January 23, 2025 15:23
@nazarhussain nazarhussain changed the title feat: use named exports to expose different hashers feat!: use named exports to expose different hashers Jan 23, 2025
Copy link

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: d697d25 Previous: eaa5422 Ratio
digestTwoHashObjects 50023 times 48.180 ms/op 48.343 ms/op 1.00
digest2Bytes32 50023 times 55.509 ms/op 54.914 ms/op 1.01
digest 50023 times 53.735 ms/op 54.120 ms/op 0.99
input length 32 1.1970 us/op 1.1790 us/op 1.02
input length 64 1.3420 us/op 1.3320 us/op 1.01
input length 128 2.2370 us/op 2.2620 us/op 0.99
input length 256 3.3600 us/op 3.3930 us/op 0.99
input length 512 5.4880 us/op 5.5310 us/op 0.99
input length 1024 10.884 us/op 10.738 us/op 1.01
digest 1000000 times 866.77 ms/op 862.63 ms/op 1.00
hashObjectToByteArray 50023 times 1.2303 ms/op 1.2296 ms/op 1.00
byteArrayToHashObject 50023 times 1.5843 ms/op 1.5556 ms/op 1.02
digest64 200092 times 216.28 ms/op 212.55 ms/op 1.02
hash 200092 times using batchHash4UintArray64s 249.83 ms/op 254.50 ms/op 0.98
digest64HashObjects 200092 times 192.18 ms/op 192.40 ms/op 1.00
hash 200092 times using batchHash4HashObjectInputs 210.37 ms/op 211.13 ms/op 1.00
getGindicesAtDepth 3.6370 us/op 3.6650 us/op 0.99
iterateAtDepth 6.7080 us/op 6.4020 us/op 1.05
getGindexBits 415.00 ns/op 393.00 ns/op 1.06
gindexIterator 940.00 ns/op 865.00 ns/op 1.09
HashComputationLevel.push then loop 28.530 ms/op 28.634 ms/op 1.00
HashComputation[] push then loop 49.557 ms/op 49.189 ms/op 1.01
hash 2 Uint8Array 500000 times - hashtree 220.91 ms/op 221.86 ms/op 1.00
hashTwoObjects 500000 times - hashtree 207.65 ms/op 210.17 ms/op 0.99
executeHashComputations - hashtree 10.981 ms/op 9.7417 ms/op 1.13
hash 2 Uint8Array 500000 times - as-sha256 569.59 ms/op 559.74 ms/op 1.02
hashTwoObjects 500000 times - as-sha256 506.11 ms/op 509.62 ms/op 0.99
executeHashComputations - as-sha256 49.563 ms/op 47.231 ms/op 1.05
hash 2 Uint8Array 500000 times - noble 1.3372 s/op 1.2780 s/op 1.05
hashTwoObjects 500000 times - noble 1.9458 s/op 1.7553 s/op 1.11
executeHashComputations - noble 37.195 ms/op 37.065 ms/op 1.00
getHashComputations 2.8456 ms/op 2.2099 ms/op 1.29
executeHashComputations 10.427 ms/op 12.175 ms/op 0.86
get root 16.368 ms/op 15.127 ms/op 1.08
getNodeH() x7812.5 avg hindex 12.292 us/op 12.232 us/op 1.00
getNodeH() x7812.5 index 0 7.4660 us/op 7.5140 us/op 0.99
getNodeH() x7812.5 index 7 7.6190 us/op 7.6380 us/op 1.00
getNodeH() x7812.5 index 7 with key array 6.4250 us/op 6.3410 us/op 1.01
new LeafNode() x7812.5 440.90 us/op 303.19 us/op 1.45
getHashComputations 250000 nodes 15.465 ms/op 15.022 ms/op 1.03
batchHash 250000 nodes 91.485 ms/op 89.300 ms/op 1.02
get root 250000 nodes 119.25 ms/op 118.05 ms/op 1.01
getHashComputations 500000 nodes 28.841 ms/op 30.704 ms/op 0.94
batchHash 500000 nodes 176.29 ms/op 169.24 ms/op 1.04
get root 500000 nodes 238.31 ms/op 227.96 ms/op 1.05
getHashComputations 1000000 nodes 60.459 ms/op 82.694 ms/op 0.73
batchHash 1000000 nodes 357.63 ms/op 325.52 ms/op 1.10
get root 1000000 nodes 476.98 ms/op 452.12 ms/op 1.05
multiproof - depth 15, 1 requested leaves 9.9930 us/op 8.5090 us/op 1.17
tree offset multiproof - depth 15, 1 requested leaves 21.312 us/op 19.038 us/op 1.12
compact multiproof - depth 15, 1 requested leaves 4.3360 us/op 3.4770 us/op 1.25
multiproof - depth 15, 2 requested leaves 14.623 us/op 12.443 us/op 1.18
tree offset multiproof - depth 15, 2 requested leaves 25.652 us/op 22.529 us/op 1.14
compact multiproof - depth 15, 2 requested leaves 4.4050 us/op 3.4040 us/op 1.29
multiproof - depth 15, 3 requested leaves 19.526 us/op 17.029 us/op 1.15
tree offset multiproof - depth 15, 3 requested leaves 33.121 us/op 29.964 us/op 1.11
compact multiproof - depth 15, 3 requested leaves 6.2070 us/op 4.4500 us/op 1.39
multiproof - depth 15, 4 requested leaves 26.230 us/op 24.254 us/op 1.08
tree offset multiproof - depth 15, 4 requested leaves 39.959 us/op 37.783 us/op 1.06
compact multiproof - depth 15, 4 requested leaves 7.0950 us/op 5.7080 us/op 1.24
packedRootsBytesToLeafNodes bytes 4000 offset 0 7.4400 us/op 6.1050 us/op 1.22
packedRootsBytesToLeafNodes bytes 4000 offset 1 7.1280 us/op 6.0280 us/op 1.18
packedRootsBytesToLeafNodes bytes 4000 offset 2 7.3620 us/op 6.1250 us/op 1.20
packedRootsBytesToLeafNodes bytes 4000 offset 3 7.5040 us/op 6.1070 us/op 1.23
subtreeFillToContents depth 40 count 250000 42.190 ms/op 51.410 ms/op 0.82
setRoot - gindexBitstring 24.053 ms/op 20.932 ms/op 1.15
setRoot - gindex 25.277 ms/op 23.149 ms/op 1.09
getRoot - gindexBitstring 2.8441 ms/op 2.6752 ms/op 1.06
getRoot - gindex 3.6655 ms/op 3.3844 ms/op 1.08
getHashObject then setHashObject 27.553 ms/op 22.727 ms/op 1.21
setNodeWithFn 24.494 ms/op 19.987 ms/op 1.23
getNodeAtDepth depth 0 x100000 283.90 us/op 280.64 us/op 1.01
setNodeAtDepth depth 0 x100000 3.1141 ms/op 2.4411 ms/op 1.28
getNodesAtDepth depth 0 x100000 312.86 us/op 312.27 us/op 1.00
setNodesAtDepth depth 0 x100000 759.65 us/op 778.15 us/op 0.98
getNodeAtDepth depth 1 x100000 343.04 us/op 345.62 us/op 0.99
setNodeAtDepth depth 1 x100000 11.551 ms/op 8.0690 ms/op 1.43
getNodesAtDepth depth 1 x100000 435.78 us/op 436.37 us/op 1.00
setNodesAtDepth depth 1 x100000 8.4489 ms/op 7.7418 ms/op 1.09
getNodeAtDepth depth 2 x100000 737.25 us/op 827.14 us/op 0.89
setNodeAtDepth depth 2 x100000 21.334 ms/op 15.321 ms/op 1.39
getNodesAtDepth depth 2 x100000 20.087 ms/op 18.648 ms/op 1.08
setNodesAtDepth depth 2 x100000 27.174 ms/op 23.504 ms/op 1.16
tree.getNodesAtDepth - gindexes 10.645 ms/op 9.6244 ms/op 1.11
tree.getNodesAtDepth - push all nodes 2.5466 ms/op 2.2478 ms/op 1.13
tree.getNodesAtDepth - navigation 311.73 us/op 311.51 us/op 1.00
tree.setNodesAtDepth - indexes 852.92 us/op 694.32 us/op 1.23
set at depth 8 681.00 ns/op 800.00 ns/op 0.85
set at depth 16 1.4700 us/op 1.1490 us/op 1.28
set at depth 32 2.3200 us/op 1.9830 us/op 1.17
iterateNodesAtDepth 8 256 15.776 us/op 14.046 us/op 1.12
getNodesAtDepth 8 256 4.0890 us/op 3.8560 us/op 1.06
iterateNodesAtDepth 16 65536 4.6803 ms/op 4.6197 ms/op 1.01
getNodesAtDepth 16 65536 2.0904 ms/op 1.8490 ms/op 1.13
iterateNodesAtDepth 32 250000 17.165 ms/op 16.809 ms/op 1.02
getNodesAtDepth 32 250000 5.9332 ms/op 5.0933 ms/op 1.16
iterateNodesAtDepth 40 250000 17.990 ms/op 17.423 ms/op 1.03
getNodesAtDepth 40 250000 6.1797 ms/op 5.1665 ms/op 1.20
250000 validators root getter 120.58 ms/op 114.66 ms/op 1.05
250000 validators batchHash() 117.62 ms/op 109.43 ms/op 1.07
250000 validators hashComputations 14.923 ms/op 20.603 ms/op 0.72
bitlist bytes to struct (120,90) 810.00 ns/op 725.00 ns/op 1.12
bitlist bytes to tree (120,90) 2.6830 us/op 2.9320 us/op 0.92
bitlist bytes to struct (2048,2048) 1.1380 us/op 987.00 ns/op 1.15
bitlist bytes to tree (2048,2048) 4.1590 us/op 3.9720 us/op 1.05
ByteListType - deserialize 8.1635 ms/op 7.4961 ms/op 1.09
BasicListType - deserialize 14.819 ms/op 13.922 ms/op 1.06
ByteListType - serialize 8.8220 ms/op 7.6725 ms/op 1.15
BasicListType - serialize 11.303 ms/op 9.8892 ms/op 1.14
BasicListType - tree_convertToStruct 26.959 ms/op 25.444 ms/op 1.06
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 5.1379 ms/op 4.5609 ms/op 1.13
List[uint8, 68719476736] len 300000 ViewDU.get(i) 4.4389 ms/op 4.2541 ms/op 1.04
Array.push len 300000 empty Array - number 7.2525 ms/op 6.9765 ms/op 1.04
Array.set len 300000 from new Array - number 1.8146 ms/op 1.6915 ms/op 1.07
Array.set len 300000 - number 6.1314 ms/op 5.9742 ms/op 1.03
Uint8Array.set len 300000 491.86 us/op 492.35 us/op 1.00
Uint32Array.set len 300000 572.93 us/op 570.54 us/op 1.00
Container({a: uint8, b: uint8}) getViewDU x300000 27.393 ms/op 25.408 ms/op 1.08
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 11.314 ms/op 10.677 ms/op 1.06
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 210.10 ms/op 214.62 ms/op 0.98
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 283.01 ms/op 268.49 ms/op 1.05
List(Container) len 300000 ViewDU.get(i) 7.6251 ms/op 6.8154 ms/op 1.12
List(Container) len 300000 ViewDU.getReadonly(i) 7.6657 ms/op 6.6002 ms/op 1.16
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 37.996 ms/op 37.503 ms/op 1.01
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 6.5580 ms/op 5.4542 ms/op 1.20
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 7.4548 ms/op 6.3123 ms/op 1.18
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 7.0466 ms/op 6.2646 ms/op 1.12
Array.push len 300000 empty Array - object 7.2924 ms/op 6.8085 ms/op 1.07
Array.set len 300000 from new Array - object 2.2354 ms/op 2.0685 ms/op 1.08
Array.set len 300000 - object 7.0338 ms/op 6.5557 ms/op 1.07
cachePermanentRootStruct no cache 5.8850 us/op 5.5030 us/op 1.07
cachePermanentRootStruct with cache 276.00 ns/op 233.00 ns/op 1.18
epochParticipation len 250000 rws 7813 2.4273 ms/op 2.2787 ms/op 1.07
BeaconState ViewDU hashTreeRoot() vc=200000 111.84 ms/op 114.70 ms/op 0.98
BeaconState ViewDU recursive hash - commit step vc=200000 4.3809 ms/op 5.1081 ms/op 0.86
BeaconState ViewDU validator tree creation vc=10000 40.208 ms/op 39.330 ms/op 1.02
BeaconState ViewDU batchHashTreeRoot vc=200000 106.29 ms/op 106.72 ms/op 1.00
BeaconState ViewDU hashTreeRoot - commit step vc=200000 91.324 ms/op 92.361 ms/op 0.99
BeaconState ViewDU hashTreeRoot - hash step vc=200000 17.722 ms/op 17.984 ms/op 0.99
deserialize Attestation - tree 3.8940 us/op 3.6790 us/op 1.06
deserialize Attestation - struct 2.0900 us/op 1.9310 us/op 1.08
deserialize SignedAggregateAndProof - tree 5.3300 us/op 4.7860 us/op 1.11
deserialize SignedAggregateAndProof - struct 3.4040 us/op 3.1420 us/op 1.08
deserialize SyncCommitteeMessage - tree 1.5280 us/op 1.3860 us/op 1.10
deserialize SyncCommitteeMessage - struct 1.2450 us/op 1.0270 us/op 1.21
deserialize SignedContributionAndProof - tree 3.2090 us/op 3.0010 us/op 1.07
deserialize SignedContributionAndProof - struct 2.6050 us/op 2.5110 us/op 1.04
deserialize SignedBeaconBlock - tree 313.69 us/op 277.30 us/op 1.13
deserialize SignedBeaconBlock - struct 132.76 us/op 122.23 us/op 1.09
BeaconState vc 300000 - deserialize tree 691.46 ms/op 676.34 ms/op 1.02
BeaconState vc 300000 - serialize tree 128.18 ms/op 167.42 ms/op 0.77
BeaconState.historicalRoots vc 300000 - deserialize tree 896.00 ns/op 862.00 ns/op 1.04
BeaconState.historicalRoots vc 300000 - serialize tree 720.00 ns/op 704.00 ns/op 1.02
BeaconState.validators vc 300000 - deserialize tree 621.42 ms/op 624.22 ms/op 1.00
BeaconState.validators vc 300000 - serialize tree 108.47 ms/op 117.23 ms/op 0.93
BeaconState.balances vc 300000 - deserialize tree 26.316 ms/op 25.712 ms/op 1.02
BeaconState.balances vc 300000 - serialize tree 5.7562 ms/op 4.8865 ms/op 1.18
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 1.2989 ms/op 1.2270 ms/op 1.06
BeaconState.previousEpochParticipation vc 300000 - serialize tree 359.30 us/op 340.18 us/op 1.06
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 1.2752 ms/op 1.2029 ms/op 1.06
BeaconState.currentEpochParticipation vc 300000 - serialize tree 351.22 us/op 343.08 us/op 1.02
BeaconState.inactivityScores vc 300000 - deserialize tree 29.995 ms/op 28.260 ms/op 1.06
BeaconState.inactivityScores vc 300000 - serialize tree 4.0149 ms/op 5.1677 ms/op 0.78
hashTreeRoot Attestation - struct 16.077 us/op 22.592 us/op 0.71
hashTreeRoot Attestation - tree 8.9210 us/op 9.3680 us/op 0.95
hashTreeRoot SignedAggregateAndProof - struct 24.090 us/op 26.281 us/op 0.92
hashTreeRoot SignedAggregateAndProof - tree 13.232 us/op 13.997 us/op 0.95
hashTreeRoot SyncCommitteeMessage - struct 6.1930 us/op 6.8460 us/op 0.90
hashTreeRoot SyncCommitteeMessage - tree 3.5620 us/op 3.9930 us/op 0.89
hashTreeRoot SignedContributionAndProof - struct 15.021 us/op 16.280 us/op 0.92
hashTreeRoot SignedContributionAndProof - tree 9.1060 us/op 9.5780 us/op 0.95
hashTreeRoot SignedBeaconBlock - struct 1.4017 ms/op 1.3779 ms/op 1.02
hashTreeRoot SignedBeaconBlock - tree 798.39 us/op 853.85 us/op 0.94
hashTreeRoot Validator - struct 7.9690 us/op 9.2120 us/op 0.87
hashTreeRoot Validator - tree 7.0550 us/op 7.9510 us/op 0.89
BeaconState vc 300000 - hashTreeRoot tree 2.2686 s/op 2.3690 s/op 0.96
BeaconState vc 300000 - batchHashTreeRoot tree 4.3020 s/op 4.3481 s/op 0.99
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 1.0840 us/op 1.1480 us/op 0.94
BeaconState.validators vc 300000 - hashTreeRoot tree 2.5085 s/op 2.6108 s/op 0.96
BeaconState.balances vc 300000 - hashTreeRoot tree 38.549 ms/op 36.774 ms/op 1.05
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 4.2859 ms/op 4.5261 ms/op 0.95
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 4.1644 ms/op 4.4370 ms/op 0.94
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 33.588 ms/op 36.127 ms/op 0.93
hash64 x18 9.1550 us/op 9.2710 us/op 0.99
hashTwoObjects x18 7.9110 us/op 8.4270 us/op 0.94
hash64 x1740 830.14 us/op 842.59 us/op 0.99
hashTwoObjects x1740 723.89 us/op 782.48 us/op 0.93
hash64 x2700000 1.2933 s/op 1.3137 s/op 0.98
hashTwoObjects x2700000 1.1282 s/op 1.2167 s/op 0.93
get_exitEpoch - ContainerType 281.00 ns/op 272.00 ns/op 1.03
get_exitEpoch - ContainerNodeStructType 293.00 ns/op 297.00 ns/op 0.99
set_exitEpoch - ContainerType 307.00 ns/op 285.00 ns/op 1.08
set_exitEpoch - ContainerNodeStructType 298.00 ns/op 294.00 ns/op 1.01
get_pubkey - ContainerType 1.1320 us/op 1.1750 us/op 0.96
get_pubkey - ContainerNodeStructType 287.00 ns/op 320.00 ns/op 0.90
hashTreeRoot - ContainerType 468.00 ns/op 548.00 ns/op 0.85
hashTreeRoot - ContainerNodeStructType 462.00 ns/op 491.00 ns/op 0.94
createProof - ContainerType 4.6190 us/op 4.6070 us/op 1.00
createProof - ContainerNodeStructType 24.545 us/op 24.738 us/op 0.99
serialize - ContainerType 1.9360 us/op 1.8810 us/op 1.03
serialize - ContainerNodeStructType 1.6170 us/op 1.6330 us/op 0.99
set_exitEpoch_and_hashTreeRoot - ContainerType 2.9050 us/op 3.1980 us/op 0.91
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 8.0980 us/op 8.4070 us/op 0.96
Array - for of 8.3410 us/op 5.8240 us/op 1.43
Array - for(;;) 8.3890 us/op 5.6630 us/op 1.48
basicListValue.readonlyValuesArray() 6.8376 ms/op 5.7234 ms/op 1.19
basicListValue.readonlyValuesArray() + loop all 6.7101 ms/op 5.8158 ms/op 1.15
compositeListValue.readonlyValuesArray() 32.467 ms/op 29.962 ms/op 1.08
compositeListValue.readonlyValuesArray() + loop all 29.165 ms/op 32.100 ms/op 0.91
Number64UintType - get balances list 5.1095 ms/op 4.7705 ms/op 1.07
Number64UintType - set balances list 10.168 ms/op 10.118 ms/op 1.00
Number64UintType - get and increase 10 then set 44.830 ms/op 43.958 ms/op 1.02
Number64UintType - increase 10 using applyDelta 17.673 ms/op 17.426 ms/op 1.01
Number64UintType - increase 10 using applyDeltaInBatch 17.594 ms/op 17.727 ms/op 0.99
tree_newTreeFromUint64Deltas 21.859 ms/op 22.925 ms/op 0.95
unsafeUint8ArrayToTree 42.221 ms/op 42.145 ms/op 1.00
bitLength(50) 274.00 ns/op 273.00 ns/op 1.00
bitLengthStr(50) 240.00 ns/op 250.00 ns/op 0.96
bitLength(8000) 267.00 ns/op 275.00 ns/op 0.97
bitLengthStr(8000) 279.00 ns/op 285.00 ns/op 0.98
bitLength(250000) 265.00 ns/op 272.00 ns/op 0.97
bitLengthStr(250000) 325.00 ns/op 313.00 ns/op 1.04
floor - Math.floor (53) 1.2450 ns/op 1.2431 ns/op 1.00
floor - << 0 (53) 1.2436 ns/op 1.2434 ns/op 1.00
floor - Math.floor (512) 1.2434 ns/op 1.2434 ns/op 1.00
floor - << 0 (512) 1.2475 ns/op 1.2440 ns/op 1.00
fnIf(0) 1.5583 ns/op 1.5569 ns/op 1.00
fnSwitch(0) 2.1787 ns/op 2.1830 ns/op 1.00
fnObj(0) 1.5613 ns/op 1.5563 ns/op 1.00
fnArr(0) 1.5565 ns/op 1.5568 ns/op 1.00
fnIf(4) 2.1755 ns/op 2.1751 ns/op 1.00
fnSwitch(4) 2.1750 ns/op 2.2175 ns/op 0.98
fnObj(4) 1.5580 ns/op 1.5545 ns/op 1.00
fnArr(4) 1.5555 ns/op 1.5613 ns/op 1.00
fnIf(9) 3.1079 ns/op 3.1100 ns/op 1.00
fnSwitch(9) 2.1771 ns/op 2.1766 ns/op 1.00
fnObj(9) 1.5856 ns/op 1.5570 ns/op 1.02
fnArr(9) 1.5547 ns/op 1.5640 ns/op 0.99
Container {a,b,vec} - as struct x100000 124.67 us/op 124.64 us/op 1.00
Container {a,b,vec} - as tree x100000 902.22 us/op 874.52 us/op 1.03
Container {a,vec,b} - as struct x100000 155.98 us/op 155.72 us/op 1.00
Container {a,vec,b} - as tree x100000 559.89 us/op 497.77 us/op 1.12
get 2 props x1000000 - rawObject 312.71 us/op 312.16 us/op 1.00
get 2 props x1000000 - proxy 73.159 ms/op 74.313 ms/op 0.98
get 2 props x1000000 - customObj 311.09 us/op 312.21 us/op 1.00
Simple object binary -> struct 953.00 ns/op 599.00 ns/op 1.59
Simple object binary -> tree_backed 2.5480 us/op 1.7140 us/op 1.49
Simple object struct -> tree_backed 2.8570 us/op 2.2600 us/op 1.26
Simple object tree_backed -> struct 2.5590 us/op 1.6100 us/op 1.59
Simple object struct -> binary 1.1320 us/op 810.00 ns/op 1.40
Simple object tree_backed -> binary 1.7880 us/op 1.3430 us/op 1.33
aggregationBits binary -> struct 694.00 ns/op 515.00 ns/op 1.35
aggregationBits binary -> tree_backed 2.7750 us/op 2.3020 us/op 1.21
aggregationBits struct -> tree_backed 3.2540 us/op 2.6650 us/op 1.22
aggregationBits tree_backed -> struct 1.2970 us/op 1.0550 us/op 1.23
aggregationBits struct -> binary 849.00 ns/op 806.00 ns/op 1.05
aggregationBits tree_backed -> binary 1.1200 us/op 895.00 ns/op 1.25
List(uint8) 100000 binary -> struct 1.7988 ms/op 1.7281 ms/op 1.04
List(uint8) 100000 binary -> tree_backed 367.00 us/op 304.78 us/op 1.20
List(uint8) 100000 struct -> tree_backed 1.4975 ms/op 1.4790 ms/op 1.01
List(uint8) 100000 tree_backed -> struct 1.2699 ms/op 1.1232 ms/op 1.13
List(uint8) 100000 struct -> binary 1.1107 ms/op 1.1776 ms/op 0.94
List(uint8) 100000 tree_backed -> binary 117.33 us/op 107.99 us/op 1.09
List(uint64Number) 100000 binary -> struct 1.5243 ms/op 1.4030 ms/op 1.09
List(uint64Number) 100000 binary -> tree_backed 5.7872 ms/op 5.1278 ms/op 1.13
List(uint64Number) 100000 struct -> tree_backed 7.3100 ms/op 7.3909 ms/op 0.99
List(uint64Number) 100000 tree_backed -> struct 2.4472 ms/op 2.4528 ms/op 1.00
List(uint64Number) 100000 struct -> binary 1.6181 ms/op 1.6313 ms/op 0.99
List(uint64Number) 100000 tree_backed -> binary 1.0787 ms/op 1.0190 ms/op 1.06
List(Uint64Bigint) 100000 binary -> struct 4.0385 ms/op 4.0184 ms/op 1.01
List(Uint64Bigint) 100000 binary -> tree_backed 5.8831 ms/op 5.6445 ms/op 1.04
List(Uint64Bigint) 100000 struct -> tree_backed 7.6619 ms/op 7.3050 ms/op 1.05
List(Uint64Bigint) 100000 tree_backed -> struct 5.5532 ms/op 5.2533 ms/op 1.06
List(Uint64Bigint) 100000 struct -> binary 2.1801 ms/op 2.1829 ms/op 1.00
List(Uint64Bigint) 100000 tree_backed -> binary 1.4952 ms/op 1.0390 ms/op 1.44
Vector(Root) 100000 binary -> struct 38.722 ms/op 34.990 ms/op 1.11
Vector(Root) 100000 binary -> tree_backed 66.182 ms/op 39.097 ms/op 1.69
Vector(Root) 100000 struct -> tree_backed 54.299 ms/op 55.210 ms/op 0.98
Vector(Root) 100000 tree_backed -> struct 57.330 ms/op 53.862 ms/op 1.06
Vector(Root) 100000 struct -> binary 2.8079 ms/op 3.1628 ms/op 0.89
Vector(Root) 100000 tree_backed -> binary 7.1383 ms/op 6.0080 ms/op 1.19
List(Validator) 100000 binary -> struct 110.28 ms/op 105.99 ms/op 1.04
List(Validator) 100000 binary -> tree_backed 382.92 ms/op 382.12 ms/op 1.00
List(Validator) 100000 struct -> tree_backed 399.93 ms/op 399.87 ms/op 1.00
List(Validator) 100000 tree_backed -> struct 222.35 ms/op 229.28 ms/op 0.97
List(Validator) 100000 struct -> binary 32.053 ms/op 29.617 ms/op 1.08
List(Validator) 100000 tree_backed -> binary 110.26 ms/op 113.17 ms/op 0.97
List(Validator-NS) 100000 binary -> struct 119.64 ms/op 107.63 ms/op 1.11
List(Validator-NS) 100000 binary -> tree_backed 150.11 ms/op 165.90 ms/op 0.90
List(Validator-NS) 100000 struct -> tree_backed 211.20 ms/op 210.08 ms/op 1.01
List(Validator-NS) 100000 tree_backed -> struct 176.49 ms/op 176.02 ms/op 1.00
List(Validator-NS) 100000 struct -> binary 31.470 ms/op 30.296 ms/op 1.04
List(Validator-NS) 100000 tree_backed -> binary 34.498 ms/op 36.050 ms/op 0.96
get epochStatuses - MutableVector 102.87 us/op 103.06 us/op 1.00
get epochStatuses - ViewDU 212.54 us/op 206.51 us/op 1.03
set epochStatuses - ListTreeView 2.2761 ms/op 2.1855 ms/op 1.04
set epochStatuses - ListTreeView - set() 479.69 us/op 466.67 us/op 1.03
set epochStatuses - ListTreeView - commit() 822.46 us/op 767.17 us/op 1.07
bitstring 517.34 ns/op 515.30 ns/op 1.00
bit mask 13.702 ns/op 13.625 ns/op 1.01
struct - increase slot to 1000000 933.33 us/op 947.66 us/op 0.98
UintNumberType - increase slot to 1000000 28.371 ms/op 27.417 ms/op 1.03
UintBigintType - increase slot to 1000000 185.55 ms/op 181.83 ms/op 1.02
UintBigint8 x 100000 tree_deserialize 6.0285 ms/op 5.6680 ms/op 1.06
UintBigint8 x 100000 tree_serialize 1.1579 ms/op 1.0976 ms/op 1.05
UintBigint16 x 100000 tree_deserialize 7.4737 ms/op 5.2594 ms/op 1.42
UintBigint16 x 100000 tree_serialize 1.4304 ms/op 1.3018 ms/op 1.10
UintBigint32 x 100000 tree_deserialize 5.7529 ms/op 5.4588 ms/op 1.05
UintBigint32 x 100000 tree_serialize 1.9269 ms/op 1.8521 ms/op 1.04
UintBigint64 x 100000 tree_deserialize 6.1642 ms/op 6.1015 ms/op 1.01
UintBigint64 x 100000 tree_serialize 2.5965 ms/op 2.5449 ms/op 1.02
UintBigint8 x 100000 value_deserialize 436.65 us/op 435.90 us/op 1.00
UintBigint8 x 100000 value_serialize 811.82 us/op 766.67 us/op 1.06
UintBigint16 x 100000 value_deserialize 467.30 us/op 466.55 us/op 1.00
UintBigint16 x 100000 value_serialize 840.67 us/op 814.29 us/op 1.03
UintBigint32 x 100000 value_deserialize 498.76 us/op 497.94 us/op 1.00
UintBigint32 x 100000 value_serialize 886.29 us/op 861.73 us/op 1.03
UintBigint64 x 100000 value_deserialize 561.50 us/op 563.65 us/op 1.00
UintBigint64 x 100000 value_serialize 1.1045 ms/op 1.0761 ms/op 1.03
UintBigint8 x 100000 deserialize 3.4354 ms/op 3.6217 ms/op 0.95
UintBigint8 x 100000 serialize 1.5725 ms/op 1.5562 ms/op 1.01
UintBigint16 x 100000 deserialize 3.9283 ms/op 3.7344 ms/op 1.05
UintBigint16 x 100000 serialize 1.5945 ms/op 1.5360 ms/op 1.04
UintBigint32 x 100000 deserialize 3.7207 ms/op 3.5466 ms/op 1.05
UintBigint32 x 100000 serialize 3.0892 ms/op 3.7325 ms/op 0.83
UintBigint64 x 100000 deserialize 4.5998 ms/op 4.4354 ms/op 1.04
UintBigint64 x 100000 serialize 1.6722 ms/op 1.6573 ms/op 1.01
UintBigint128 x 100000 deserialize 6.5923 ms/op 5.8991 ms/op 1.12
UintBigint128 x 100000 serialize 14.648 ms/op 15.735 ms/op 0.93
UintBigint256 x 100000 deserialize 8.6302 ms/op 9.4986 ms/op 0.91
UintBigint256 x 100000 serialize 42.988 ms/op 44.685 ms/op 0.96
Slice from Uint8Array x25000 1.3207 ms/op 1.4345 ms/op 0.92
Slice from ArrayBuffer x25000 16.304 ms/op 17.134 ms/op 0.95
Slice from ArrayBuffer x25000 + new Uint8Array 17.888 ms/op 18.761 ms/op 0.95
Copy Uint8Array 100000 iterate 2.6758 ms/op 2.7570 ms/op 0.97
Copy Uint8Array 100000 slice 104.63 us/op 107.51 us/op 0.97
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 123.01 us/op 109.64 us/op 1.12
Copy Buffer 100000 Uint8Array.prototype.slice.call 119.60 us/op 108.55 us/op 1.10
Copy Uint8Array 100000 slice + set 224.56 us/op 218.44 us/op 1.03
Copy Uint8Array 100000 subarray + set 112.17 us/op 108.58 us/op 1.03
Copy Uint8Array 100000 slice arrayBuffer 111.26 us/op 108.83 us/op 1.02
Uint64 deserialize 100000 - iterate Uint8Array 2.0553 ms/op 2.0431 ms/op 1.01
Uint64 deserialize 100000 - by Uint32A 2.0751 ms/op 2.0785 ms/op 1.00
Uint64 deserialize 100000 - by DataView.getUint32 x2 2.0664 ms/op 1.8679 ms/op 1.11
Uint64 deserialize 100000 - by DataView.getBigUint64 5.1351 ms/op 5.0165 ms/op 1.02
Uint64 deserialize 100000 - by byte 40.717 ms/op 40.742 ms/op 1.00

by benchmarkbot/action

@wemeetagain wemeetagain merged commit f763c8a into master Jan 23, 2025
9 checks passed
@wemeetagain wemeetagain deleted the nh/named-exports branch January 23, 2025 16:20
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.

3 participants