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: correctly export hashers from persistent-merkle-tree #460

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Jan 23, 2025

Motivation

Current export does not work as it has to match file path, otherwise it's not possible to use it in Lodestar
image

@chainsafe/lodestar: $ tsc -p tsconfig.build.json && yarn write-git-data
@chainsafe/lodestar: src/applyPreset.ts:3:22 - error TS2307: Cannot find module '@chainsafe/persistent-merkle-tree/as-sha256' or its corresponding type declarations.
@chainsafe/lodestar:   There are types at '/home/nico/projects/ethereum/lodestar/node_modules/@chainsafe/persistent-merkle-tree/lib/hasher/as-sha256.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.
@chainsafe/lodestar: 3 import {hasher} from "@chainsafe/persistent-merkle-tree/as-sha256";
@chainsafe/lodestar:                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@chainsafe/lodestar: Found 1 error in src/applyPreset.ts:3

Description

Correctly export hashers from persistent-merkle-tree

@nflaig nflaig requested a review from a team as a code owner January 23, 2025 19:52
@wemeetagain wemeetagain merged commit 1eba2f9 into master Jan 23, 2025
8 checks passed
@wemeetagain wemeetagain deleted the nflaig/fix-hasher-exports branch January 23, 2025 19:53
Copy link

Performance Report

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 6d494c0 Previous: 7e0a540 Ratio
UintBigint8 x 100000 tree_serialize 655.51 us/op 2.4970 ms/op 0.26
Full benchmark results
Benchmark suite Current: 6d494c0 Previous: 7e0a540 Ratio
digestTwoHashObjects 50023 times 48.330 ms/op 48.529 ms/op 1.00
digest2Bytes32 50023 times 54.605 ms/op 55.244 ms/op 0.99
digest 50023 times 53.600 ms/op 53.950 ms/op 0.99
input length 32 1.1860 us/op 1.2100 us/op 0.98
input length 64 1.3330 us/op 1.3650 us/op 0.98
input length 128 2.3030 us/op 2.3000 us/op 1.00
input length 256 3.3600 us/op 3.3870 us/op 0.99
input length 512 5.6580 us/op 5.5980 us/op 1.01
input length 1024 10.833 us/op 10.795 us/op 1.00
digest 1000000 times 875.44 ms/op 879.63 ms/op 1.00
hashObjectToByteArray 50023 times 1.2287 ms/op 1.2291 ms/op 1.00
byteArrayToHashObject 50023 times 1.6477 ms/op 1.6577 ms/op 0.99
digest64 200092 times 215.79 ms/op 216.71 ms/op 1.00
hash 200092 times using batchHash4UintArray64s 236.78 ms/op 236.41 ms/op 1.00
digest64HashObjects 200092 times 194.23 ms/op 193.25 ms/op 1.01
hash 200092 times using batchHash4HashObjectInputs 203.13 ms/op 201.39 ms/op 1.01
getGindicesAtDepth 3.6780 us/op 3.6170 us/op 1.02
iterateAtDepth 6.7340 us/op 6.6470 us/op 1.01
getGindexBits 414.00 ns/op 391.00 ns/op 1.06
gindexIterator 957.00 ns/op 861.00 ns/op 1.11
HashComputationLevel.push then loop 30.903 ms/op 26.336 ms/op 1.17
HashComputation[] push then loop 49.222 ms/op 48.431 ms/op 1.02
hash 2 Uint8Array 500000 times - hashtree 235.92 ms/op 237.63 ms/op 0.99
hashTwoObjects 500000 times - hashtree 224.30 ms/op 227.72 ms/op 0.98
executeHashComputations - hashtree 10.201 ms/op 10.604 ms/op 0.96
hash 2 Uint8Array 500000 times - as-sha256 563.29 ms/op 558.70 ms/op 1.01
hashTwoObjects 500000 times - as-sha256 506.80 ms/op 514.00 ms/op 0.99
executeHashComputations - as-sha256 46.563 ms/op 45.849 ms/op 1.02
hash 2 Uint8Array 500000 times - noble 1.3546 s/op 1.2034 s/op 1.13
hashTwoObjects 500000 times - noble 1.7816 s/op 1.6305 s/op 1.09
executeHashComputations - noble 36.590 ms/op 36.707 ms/op 1.00
getHashComputations 2.2097 ms/op 2.7293 ms/op 0.81
executeHashComputations 9.8243 ms/op 9.6419 ms/op 1.02
get root 16.281 ms/op 15.479 ms/op 1.05
getNodeH() x7812.5 avg hindex 12.240 us/op 12.320 us/op 0.99
getNodeH() x7812.5 index 0 7.6650 us/op 7.5940 us/op 1.01
getNodeH() x7812.5 index 7 7.5700 us/op 7.6170 us/op 0.99
getNodeH() x7812.5 index 7 with key array 6.3450 us/op 6.3840 us/op 0.99
new LeafNode() x7812.5 350.68 us/op 312.47 us/op 1.12
getHashComputations 250000 nodes 15.217 ms/op 14.856 ms/op 1.02
batchHash 250000 nodes 86.047 ms/op 99.120 ms/op 0.87
get root 250000 nodes 124.23 ms/op 116.32 ms/op 1.07
getHashComputations 500000 nodes 28.786 ms/op 35.989 ms/op 0.80
batchHash 500000 nodes 156.93 ms/op 154.25 ms/op 1.02
get root 500000 nodes 246.73 ms/op 233.84 ms/op 1.06
getHashComputations 1000000 nodes 89.741 ms/op 85.381 ms/op 1.05
batchHash 1000000 nodes 316.49 ms/op 310.17 ms/op 1.02
get root 1000000 nodes 492.63 ms/op 465.09 ms/op 1.06
multiproof - depth 15, 1 requested leaves 10.077 us/op 7.9240 us/op 1.27
tree offset multiproof - depth 15, 1 requested leaves 21.925 us/op 18.309 us/op 1.20
compact multiproof - depth 15, 1 requested leaves 4.2600 us/op 2.9560 us/op 1.44
multiproof - depth 15, 2 requested leaves 14.635 us/op 11.536 us/op 1.27
tree offset multiproof - depth 15, 2 requested leaves 26.316 us/op 21.588 us/op 1.22
compact multiproof - depth 15, 2 requested leaves 4.3670 us/op 2.9620 us/op 1.47
multiproof - depth 15, 3 requested leaves 20.105 us/op 15.950 us/op 1.26
tree offset multiproof - depth 15, 3 requested leaves 33.958 us/op 27.514 us/op 1.23
compact multiproof - depth 15, 3 requested leaves 6.1230 us/op 3.6860 us/op 1.66
multiproof - depth 15, 4 requested leaves 26.266 us/op 21.535 us/op 1.22
tree offset multiproof - depth 15, 4 requested leaves 41.549 us/op 34.014 us/op 1.22
compact multiproof - depth 15, 4 requested leaves 7.3870 us/op 4.2420 us/op 1.74
packedRootsBytesToLeafNodes bytes 4000 offset 0 7.9300 us/op 5.5840 us/op 1.42
packedRootsBytesToLeafNodes bytes 4000 offset 1 7.8540 us/op 5.5130 us/op 1.42
packedRootsBytesToLeafNodes bytes 4000 offset 2 7.8530 us/op 5.5250 us/op 1.42
packedRootsBytesToLeafNodes bytes 4000 offset 3 8.0160 us/op 5.6080 us/op 1.43
subtreeFillToContents depth 40 count 250000 59.229 ms/op 47.888 ms/op 1.24
setRoot - gindexBitstring 24.296 ms/op 20.908 ms/op 1.16
setRoot - gindex 24.633 ms/op 21.839 ms/op 1.13
getRoot - gindexBitstring 2.6994 ms/op 2.4933 ms/op 1.08
getRoot - gindex 3.3550 ms/op 3.1464 ms/op 1.07
getHashObject then setHashObject 25.495 ms/op 22.007 ms/op 1.16
setNodeWithFn 22.600 ms/op 19.947 ms/op 1.13
getNodeAtDepth depth 0 x100000 280.25 us/op 280.58 us/op 1.00
setNodeAtDepth depth 0 x100000 2.4818 ms/op 2.5724 ms/op 0.96
getNodesAtDepth depth 0 x100000 312.29 us/op 313.56 us/op 1.00
setNodesAtDepth depth 0 x100000 756.00 us/op 766.40 us/op 0.99
getNodeAtDepth depth 1 x100000 343.15 us/op 342.49 us/op 1.00
setNodeAtDepth depth 1 x100000 8.9566 ms/op 9.5675 ms/op 0.94
getNodesAtDepth depth 1 x100000 436.47 us/op 436.35 us/op 1.00
setNodesAtDepth depth 1 x100000 9.0705 ms/op 8.1740 ms/op 1.11
getNodeAtDepth depth 2 x100000 766.74 us/op 735.08 us/op 1.04
setNodeAtDepth depth 2 x100000 17.860 ms/op 18.162 ms/op 0.98
getNodesAtDepth depth 2 x100000 19.873 ms/op 18.383 ms/op 1.08
setNodesAtDepth depth 2 x100000 25.715 ms/op 24.264 ms/op 1.06
tree.getNodesAtDepth - gindexes 10.741 ms/op 8.4081 ms/op 1.28
tree.getNodesAtDepth - push all nodes 2.0429 ms/op 2.3970 ms/op 0.85
tree.getNodesAtDepth - navigation 311.71 us/op 311.49 us/op 1.00
tree.setNodesAtDepth - indexes 726.55 us/op 703.73 us/op 1.03
set at depth 8 878.00 ns/op 677.00 ns/op 1.30
set at depth 16 1.3210 us/op 1.2660 us/op 1.04
set at depth 32 2.2780 us/op 2.1640 us/op 1.05
iterateNodesAtDepth 8 256 15.182 us/op 14.403 us/op 1.05
getNodesAtDepth 8 256 3.8910 us/op 3.7790 us/op 1.03
iterateNodesAtDepth 16 65536 4.4554 ms/op 4.3729 ms/op 1.02
getNodesAtDepth 16 65536 1.6494 ms/op 2.0576 ms/op 0.80
iterateNodesAtDepth 32 250000 16.374 ms/op 18.258 ms/op 0.90
getNodesAtDepth 32 250000 5.5635 ms/op 4.4631 ms/op 1.25
iterateNodesAtDepth 40 250000 16.452 ms/op 15.192 ms/op 1.08
getNodesAtDepth 40 250000 6.0231 ms/op 4.4458 ms/op 1.35
250000 validators root getter 126.59 ms/op 117.50 ms/op 1.08
250000 validators batchHash() 126.62 ms/op 82.860 ms/op 1.53
250000 validators hashComputations 21.620 ms/op 17.301 ms/op 1.25
bitlist bytes to struct (120,90) 1.0950 us/op 752.00 ns/op 1.46
bitlist bytes to tree (120,90) 4.3400 us/op 2.3620 us/op 1.84
bitlist bytes to struct (2048,2048) 2.0560 us/op 999.00 ns/op 2.06
bitlist bytes to tree (2048,2048) 8.8840 us/op 3.8200 us/op 2.33
ByteListType - deserialize 14.509 ms/op 7.0056 ms/op 2.07
BasicListType - deserialize 19.108 ms/op 13.253 ms/op 1.44
ByteListType - serialize 11.289 ms/op 7.5901 ms/op 1.49
BasicListType - serialize 13.710 ms/op 9.6562 ms/op 1.42
BasicListType - tree_convertToStruct 31.854 ms/op 24.609 ms/op 1.29
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 6.9959 ms/op 4.5739 ms/op 1.53
List[uint8, 68719476736] len 300000 ViewDU.get(i) 4.4098 ms/op 4.3953 ms/op 1.00
Array.push len 300000 empty Array - number 8.1979 ms/op 6.5084 ms/op 1.26
Array.set len 300000 from new Array - number 3.8646 ms/op 1.7685 ms/op 2.19
Array.set len 300000 - number 7.5237 ms/op 5.3824 ms/op 1.40
Uint8Array.set len 300000 493.42 us/op 479.79 us/op 1.03
Uint32Array.set len 300000 572.40 us/op 545.96 us/op 1.05
Container({a: uint8, b: uint8}) getViewDU x300000 27.207 ms/op 25.344 ms/op 1.07
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 12.128 ms/op 10.415 ms/op 1.16
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 231.06 ms/op 200.12 ms/op 1.15
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 303.38 ms/op 245.33 ms/op 1.24
List(Container) len 300000 ViewDU.get(i) 8.8586 ms/op 6.5924 ms/op 1.34
List(Container) len 300000 ViewDU.getReadonly(i) 7.5938 ms/op 6.4590 ms/op 1.18
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 36.530 ms/op 38.366 ms/op 0.95
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 5.9789 ms/op 5.3177 ms/op 1.12
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 7.3727 ms/op 6.2115 ms/op 1.19
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 7.0933 ms/op 5.9959 ms/op 1.18
Array.push len 300000 empty Array - object 6.9496 ms/op 6.5023 ms/op 1.07
Array.set len 300000 from new Array - object 2.5122 ms/op 2.0024 ms/op 1.25
Array.set len 300000 - object 7.1611 ms/op 6.3993 ms/op 1.12
cachePermanentRootStruct no cache 6.0360 us/op 5.4640 us/op 1.10
cachePermanentRootStruct with cache 239.00 ns/op 204.00 ns/op 1.17
epochParticipation len 250000 rws 7813 2.5117 ms/op 2.4296 ms/op 1.03
BeaconState ViewDU hashTreeRoot() vc=200000 119.98 ms/op 112.84 ms/op 1.06
BeaconState ViewDU recursive hash - commit step vc=200000 4.7564 ms/op 4.8086 ms/op 0.99
BeaconState ViewDU validator tree creation vc=10000 41.269 ms/op 40.402 ms/op 1.02
BeaconState ViewDU batchHashTreeRoot vc=200000 111.77 ms/op 106.06 ms/op 1.05
BeaconState ViewDU hashTreeRoot - commit step vc=200000 98.023 ms/op 94.112 ms/op 1.04
BeaconState ViewDU hashTreeRoot - hash step vc=200000 18.637 ms/op 17.590 ms/op 1.06
deserialize Attestation - tree 4.8540 us/op 4.2660 us/op 1.14
deserialize Attestation - struct 2.5890 us/op 2.3270 us/op 1.11
deserialize SignedAggregateAndProof - tree 6.5450 us/op 5.8980 us/op 1.11
deserialize SignedAggregateAndProof - struct 4.2410 us/op 3.7810 us/op 1.12
deserialize SyncCommitteeMessage - tree 1.8300 us/op 1.7050 us/op 1.07
deserialize SyncCommitteeMessage - struct 1.4840 us/op 1.0590 us/op 1.40
deserialize SignedContributionAndProof - tree 3.8740 us/op 3.3600 us/op 1.15
deserialize SignedContributionAndProof - struct 3.2450 us/op 2.7690 us/op 1.17
deserialize SignedBeaconBlock - tree 382.92 us/op 330.81 us/op 1.16
deserialize SignedBeaconBlock - struct 175.57 us/op 145.17 us/op 1.21
BeaconState vc 300000 - deserialize tree 691.14 ms/op 716.48 ms/op 0.96
BeaconState vc 300000 - serialize tree 163.86 ms/op 144.22 ms/op 1.14
BeaconState.historicalRoots vc 300000 - deserialize tree 987.00 ns/op 962.00 ns/op 1.03
BeaconState.historicalRoots vc 300000 - serialize tree 870.00 ns/op 772.00 ns/op 1.13
BeaconState.validators vc 300000 - deserialize tree 653.50 ms/op 637.69 ms/op 1.02
BeaconState.validators vc 300000 - serialize tree 133.39 ms/op 121.53 ms/op 1.10
BeaconState.balances vc 300000 - deserialize tree 27.285 ms/op 29.181 ms/op 0.94
BeaconState.balances vc 300000 - serialize tree 8.0928 ms/op 5.7137 ms/op 1.42
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 1.4127 ms/op 1.3737 ms/op 1.03
BeaconState.previousEpochParticipation vc 300000 - serialize tree 359.95 us/op 366.55 us/op 0.98
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 1.3802 ms/op 1.3654 ms/op 1.01
BeaconState.currentEpochParticipation vc 300000 - serialize tree 362.86 us/op 354.21 us/op 1.02
BeaconState.inactivityScores vc 300000 - deserialize tree 29.157 ms/op 30.221 ms/op 0.96
BeaconState.inactivityScores vc 300000 - serialize tree 8.0526 ms/op 5.5013 ms/op 1.46
hashTreeRoot Attestation - struct 27.637 us/op 18.830 us/op 1.47
hashTreeRoot Attestation - tree 9.4910 us/op 9.3690 us/op 1.01
hashTreeRoot SignedAggregateAndProof - struct 34.222 us/op 25.954 us/op 1.32
hashTreeRoot SignedAggregateAndProof - tree 14.190 us/op 13.990 us/op 1.01
hashTreeRoot SyncCommitteeMessage - struct 9.8760 us/op 6.8870 us/op 1.43
hashTreeRoot SyncCommitteeMessage - tree 3.4320 us/op 4.0600 us/op 0.85
hashTreeRoot SignedContributionAndProof - struct 26.393 us/op 17.851 us/op 1.48
hashTreeRoot SignedContributionAndProof - tree 9.6540 us/op 9.6760 us/op 1.00
hashTreeRoot SignedBeaconBlock - struct 1.7872 ms/op 1.3046 ms/op 1.37
hashTreeRoot SignedBeaconBlock - tree 859.09 us/op 805.87 us/op 1.07
hashTreeRoot Validator - struct 11.026 us/op 7.8850 us/op 1.40
hashTreeRoot Validator - tree 8.8560 us/op 7.3400 us/op 1.21
BeaconState vc 300000 - hashTreeRoot tree 2.3004 s/op 2.2344 s/op 1.03
BeaconState vc 300000 - batchHashTreeRoot tree 4.3656 s/op 4.3588 s/op 1.00
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 1.1020 us/op 1.1730 us/op 0.94
BeaconState.validators vc 300000 - hashTreeRoot tree 2.4957 s/op 2.5275 s/op 0.99
BeaconState.balances vc 300000 - hashTreeRoot tree 36.370 ms/op 57.792 ms/op 0.63
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 4.4435 ms/op 4.2820 ms/op 1.04
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 4.4661 ms/op 4.2738 ms/op 1.04
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 46.961 ms/op 34.589 ms/op 1.36
hash64 x18 9.0240 us/op 9.0910 us/op 0.99
hashTwoObjects x18 8.5000 us/op 8.4740 us/op 1.00
hash64 x1740 823.75 us/op 862.84 us/op 0.95
hashTwoObjects x1740 785.09 us/op 771.67 us/op 1.02
hash64 x2700000 1.3049 s/op 1.3219 s/op 0.99
hashTwoObjects x2700000 1.2275 s/op 1.2111 s/op 1.01
get_exitEpoch - ContainerType 263.00 ns/op 307.00 ns/op 0.86
get_exitEpoch - ContainerNodeStructType 277.00 ns/op 303.00 ns/op 0.91
set_exitEpoch - ContainerType 267.00 ns/op 334.00 ns/op 0.80
set_exitEpoch - ContainerNodeStructType 306.00 ns/op 306.00 ns/op 1.00
get_pubkey - ContainerType 1.1770 us/op 1.1630 us/op 1.01
get_pubkey - ContainerNodeStructType 264.00 ns/op 318.00 ns/op 0.83
hashTreeRoot - ContainerType 465.00 ns/op 496.00 ns/op 0.94
hashTreeRoot - ContainerNodeStructType 420.00 ns/op 486.00 ns/op 0.86
createProof - ContainerType 4.4990 us/op 4.8110 us/op 0.94
createProof - ContainerNodeStructType 22.596 us/op 24.116 us/op 0.94
serialize - ContainerType 1.7010 us/op 1.8040 us/op 0.94
serialize - ContainerNodeStructType 1.5090 us/op 1.7010 us/op 0.89
set_exitEpoch_and_hashTreeRoot - ContainerType 2.8520 us/op 3.0200 us/op 0.94
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 7.8460 us/op 8.4400 us/op 0.93
Array - for of 5.7480 us/op 8.7150 us/op 0.66
Array - for(;;) 5.5780 us/op 8.6460 us/op 0.65
basicListValue.readonlyValuesArray() 5.0078 ms/op 6.5046 ms/op 0.77
basicListValue.readonlyValuesArray() + loop all 5.0606 ms/op 6.6971 ms/op 0.76
compositeListValue.readonlyValuesArray() 32.271 ms/op 36.009 ms/op 0.90
compositeListValue.readonlyValuesArray() + loop all 34.970 ms/op 32.279 ms/op 1.08
Number64UintType - get balances list 4.8741 ms/op 4.8869 ms/op 1.00
Number64UintType - set balances list 10.136 ms/op 10.557 ms/op 0.96
Number64UintType - get and increase 10 then set 38.024 ms/op 43.533 ms/op 0.87
Number64UintType - increase 10 using applyDelta 14.718 ms/op 19.685 ms/op 0.75
Number64UintType - increase 10 using applyDeltaInBatch 14.653 ms/op 18.793 ms/op 0.78
tree_newTreeFromUint64Deltas 23.071 ms/op 21.997 ms/op 1.05
unsafeUint8ArrayToTree 40.426 ms/op 41.797 ms/op 0.97
bitLength(50) 281.00 ns/op 269.00 ns/op 1.04
bitLengthStr(50) 235.00 ns/op 247.00 ns/op 0.95
bitLength(8000) 247.00 ns/op 277.00 ns/op 0.89
bitLengthStr(8000) 278.00 ns/op 302.00 ns/op 0.92
bitLength(250000) 265.00 ns/op 298.00 ns/op 0.89
bitLengthStr(250000) 306.00 ns/op 357.00 ns/op 0.86
floor - Math.floor (53) 1.2431 ns/op 1.3072 ns/op 0.95
floor - << 0 (53) 1.2444 ns/op 1.2616 ns/op 0.99
floor - Math.floor (512) 1.2442 ns/op 1.2439 ns/op 1.00
floor - << 0 (512) 1.2432 ns/op 1.2461 ns/op 1.00
fnIf(0) 1.5543 ns/op 1.5584 ns/op 1.00
fnSwitch(0) 2.2127 ns/op 2.1778 ns/op 1.02
fnObj(0) 1.5543 ns/op 1.5581 ns/op 1.00
fnArr(0) 1.5607 ns/op 1.5664 ns/op 1.00
fnIf(4) 2.1961 ns/op 2.1799 ns/op 1.01
fnSwitch(4) 2.1760 ns/op 2.1785 ns/op 1.00
fnObj(4) 1.5614 ns/op 1.5749 ns/op 0.99
fnArr(4) 1.5545 ns/op 1.5554 ns/op 1.00
fnIf(9) 3.1186 ns/op 3.1109 ns/op 1.00
fnSwitch(9) 2.1748 ns/op 2.1776 ns/op 1.00
fnObj(9) 1.5542 ns/op 1.5584 ns/op 1.00
fnArr(9) 1.5555 ns/op 1.5553 ns/op 1.00
Container {a,b,vec} - as struct x100000 124.52 us/op 124.71 us/op 1.00
Container {a,b,vec} - as tree x100000 559.74 us/op 560.04 us/op 1.00
Container {a,vec,b} - as struct x100000 155.48 us/op 156.41 us/op 0.99
Container {a,vec,b} - as tree x100000 559.62 us/op 560.17 us/op 1.00
get 2 props x1000000 - rawObject 311.53 us/op 312.05 us/op 1.00
get 2 props x1000000 - proxy 73.116 ms/op 73.097 ms/op 1.00
get 2 props x1000000 - customObj 314.67 us/op 311.04 us/op 1.01
Simple object binary -> struct 601.00 ns/op 645.00 ns/op 0.93
Simple object binary -> tree_backed 1.6270 us/op 1.8820 us/op 0.86
Simple object struct -> tree_backed 2.1180 us/op 2.5670 us/op 0.83
Simple object tree_backed -> struct 1.5220 us/op 1.8350 us/op 0.83
Simple object struct -> binary 803.00 ns/op 939.00 ns/op 0.86
Simple object tree_backed -> binary 1.3250 us/op 1.5640 us/op 0.85
aggregationBits binary -> struct 476.00 ns/op 585.00 ns/op 0.81
aggregationBits binary -> tree_backed 2.1940 us/op 2.4070 us/op 0.91
aggregationBits struct -> tree_backed 2.5230 us/op 2.9940 us/op 0.84
aggregationBits tree_backed -> struct 1.0250 us/op 1.1640 us/op 0.88
aggregationBits struct -> binary 770.00 ns/op 717.00 ns/op 1.07
aggregationBits tree_backed -> binary 931.00 ns/op 1.0550 us/op 0.88
List(uint8) 100000 binary -> struct 1.6602 ms/op 1.8198 ms/op 0.91
List(uint8) 100000 binary -> tree_backed 315.89 us/op 346.86 us/op 0.91
List(uint8) 100000 struct -> tree_backed 1.4843 ms/op 1.5056 ms/op 0.99
List(uint8) 100000 tree_backed -> struct 1.1698 ms/op 1.1729 ms/op 1.00
List(uint8) 100000 struct -> binary 1.0981 ms/op 1.1012 ms/op 1.00
List(uint8) 100000 tree_backed -> binary 111.92 us/op 114.14 us/op 0.98
List(uint64Number) 100000 binary -> struct 1.3670 ms/op 1.4289 ms/op 0.96
List(uint64Number) 100000 binary -> tree_backed 4.9232 ms/op 4.8624 ms/op 1.01
List(uint64Number) 100000 struct -> tree_backed 6.9200 ms/op 6.8250 ms/op 1.01
List(uint64Number) 100000 tree_backed -> struct 2.7039 ms/op 2.5345 ms/op 1.07
List(uint64Number) 100000 struct -> binary 1.7854 ms/op 1.5664 ms/op 1.14
List(uint64Number) 100000 tree_backed -> binary 1.1473 ms/op 1.0826 ms/op 1.06
List(Uint64Bigint) 100000 binary -> struct 3.8988 ms/op 4.2511 ms/op 0.92
List(Uint64Bigint) 100000 binary -> tree_backed 4.7255 ms/op 4.6920 ms/op 1.01
List(Uint64Bigint) 100000 struct -> tree_backed 7.3041 ms/op 7.3350 ms/op 1.00
List(Uint64Bigint) 100000 tree_backed -> struct 5.0629 ms/op 5.0881 ms/op 1.00
List(Uint64Bigint) 100000 struct -> binary 2.0751 ms/op 2.0967 ms/op 0.99
List(Uint64Bigint) 100000 tree_backed -> binary 1.1219 ms/op 1.0807 ms/op 1.04
Vector(Root) 100000 binary -> struct 37.703 ms/op 36.393 ms/op 1.04
Vector(Root) 100000 binary -> tree_backed 37.193 ms/op 34.999 ms/op 1.06
Vector(Root) 100000 struct -> tree_backed 54.908 ms/op 52.177 ms/op 1.05
Vector(Root) 100000 tree_backed -> struct 54.914 ms/op 53.658 ms/op 1.02
Vector(Root) 100000 struct -> binary 2.9122 ms/op 2.8704 ms/op 1.01
Vector(Root) 100000 tree_backed -> binary 7.7734 ms/op 7.4937 ms/op 1.04
List(Validator) 100000 binary -> struct 126.63 ms/op 99.657 ms/op 1.27
List(Validator) 100000 binary -> tree_backed 372.68 ms/op 363.03 ms/op 1.03
List(Validator) 100000 struct -> tree_backed 404.20 ms/op 389.34 ms/op 1.04
List(Validator) 100000 tree_backed -> struct 224.72 ms/op 221.44 ms/op 1.01
List(Validator) 100000 struct -> binary 28.815 ms/op 29.061 ms/op 0.99
List(Validator) 100000 tree_backed -> binary 113.94 ms/op 108.09 ms/op 1.05
List(Validator-NS) 100000 binary -> struct 103.35 ms/op 109.17 ms/op 0.95
List(Validator-NS) 100000 binary -> tree_backed 157.66 ms/op 168.32 ms/op 0.94
List(Validator-NS) 100000 struct -> tree_backed 209.07 ms/op 211.67 ms/op 0.99
List(Validator-NS) 100000 tree_backed -> struct 174.26 ms/op 172.15 ms/op 1.01
List(Validator-NS) 100000 struct -> binary 28.944 ms/op 28.920 ms/op 1.00
List(Validator-NS) 100000 tree_backed -> binary 35.391 ms/op 35.820 ms/op 0.99
get epochStatuses - MutableVector 113.88 us/op 91.386 us/op 1.25
get epochStatuses - ViewDU 175.59 us/op 209.16 us/op 0.84
set epochStatuses - ListTreeView 2.1710 ms/op 2.0436 ms/op 1.06
set epochStatuses - ListTreeView - set() 448.99 us/op 474.87 us/op 0.95
set epochStatuses - ListTreeView - commit() 815.61 us/op 778.49 us/op 1.05
bitstring 520.17 ns/op 513.54 ns/op 1.01
bit mask 13.613 ns/op 13.979 ns/op 0.97
struct - increase slot to 1000000 933.57 us/op 933.28 us/op 1.00
UintNumberType - increase slot to 1000000 28.219 ms/op 28.433 ms/op 0.99
UintBigintType - increase slot to 1000000 179.29 ms/op 177.59 ms/op 1.01
UintBigint8 x 100000 tree_deserialize 5.8598 ms/op 6.6145 ms/op 0.89
UintBigint8 x 100000 tree_serialize 655.51 us/op 2.4970 ms/op 0.26
UintBigint16 x 100000 tree_deserialize 5.1746 ms/op 5.2777 ms/op 0.98
UintBigint16 x 100000 tree_serialize 1.5833 ms/op 1.3691 ms/op 1.16
UintBigint32 x 100000 tree_deserialize 5.8126 ms/op 5.5605 ms/op 1.05
UintBigint32 x 100000 tree_serialize 1.8470 ms/op 1.8561 ms/op 1.00
UintBigint64 x 100000 tree_deserialize 6.5482 ms/op 5.9421 ms/op 1.10
UintBigint64 x 100000 tree_serialize 1.8422 ms/op 2.5064 ms/op 0.74
UintBigint8 x 100000 value_deserialize 435.27 us/op 435.46 us/op 1.00
UintBigint8 x 100000 value_serialize 810.54 us/op 771.90 us/op 1.05
UintBigint16 x 100000 value_deserialize 466.70 us/op 466.36 us/op 1.00
UintBigint16 x 100000 value_serialize 849.26 us/op 819.45 us/op 1.04
UintBigint32 x 100000 value_deserialize 503.80 us/op 503.14 us/op 1.00
UintBigint32 x 100000 value_serialize 898.62 us/op 870.67 us/op 1.03
UintBigint64 x 100000 value_deserialize 561.38 us/op 562.37 us/op 1.00
UintBigint64 x 100000 value_serialize 1.1210 ms/op 1.0653 ms/op 1.05
UintBigint8 x 100000 deserialize 3.7704 ms/op 3.2188 ms/op 1.17
UintBigint8 x 100000 serialize 1.5509 ms/op 1.5257 ms/op 1.02
UintBigint16 x 100000 deserialize 3.9075 ms/op 3.4603 ms/op 1.13
UintBigint16 x 100000 serialize 1.5993 ms/op 1.6164 ms/op 0.99
UintBigint32 x 100000 deserialize 3.8640 ms/op 3.2715 ms/op 1.18
UintBigint32 x 100000 serialize 3.1269 ms/op 2.8403 ms/op 1.10
UintBigint64 x 100000 deserialize 4.7278 ms/op 4.2585 ms/op 1.11
UintBigint64 x 100000 serialize 1.6589 ms/op 1.6745 ms/op 0.99
UintBigint128 x 100000 deserialize 6.0318 ms/op 5.5619 ms/op 1.08
UintBigint128 x 100000 serialize 15.434 ms/op 14.553 ms/op 1.06
UintBigint256 x 100000 deserialize 9.3413 ms/op 9.1865 ms/op 1.02
UintBigint256 x 100000 serialize 44.535 ms/op 41.402 ms/op 1.08
Slice from Uint8Array x25000 1.4553 ms/op 1.2909 ms/op 1.13
Slice from ArrayBuffer x25000 17.785 ms/op 15.965 ms/op 1.11
Slice from ArrayBuffer x25000 + new Uint8Array 19.640 ms/op 17.121 ms/op 1.15
Copy Uint8Array 100000 iterate 2.6776 ms/op 2.6487 ms/op 1.01
Copy Uint8Array 100000 slice 138.20 us/op 95.470 us/op 1.45
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 139.73 us/op 111.50 us/op 1.25
Copy Buffer 100000 Uint8Array.prototype.slice.call 138.14 us/op 114.75 us/op 1.20
Copy Uint8Array 100000 slice + set 288.30 us/op 234.78 us/op 1.23
Copy Uint8Array 100000 subarray + set 138.78 us/op 114.76 us/op 1.21
Copy Uint8Array 100000 slice arrayBuffer 137.18 us/op 112.47 us/op 1.22
Uint64 deserialize 100000 - iterate Uint8Array 2.2499 ms/op 2.1252 ms/op 1.06
Uint64 deserialize 100000 - by Uint32A 2.1689 ms/op 1.9165 ms/op 1.13
Uint64 deserialize 100000 - by DataView.getUint32 x2 2.2078 ms/op 1.9553 ms/op 1.13
Uint64 deserialize 100000 - by DataView.getBigUint64 5.5276 ms/op 5.0147 ms/op 1.10
Uint64 deserialize 100000 - by byte 41.454 ms/op 40.801 ms/op 1.02

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