ChainSafe / lodestar

🌟 TypeScript Implementation of Ethereum Consensus
https://lodestar.chainsafe.io
Apache License 2.0
1.19k stars 291 forks source link

chore: avoid fromHexString #7080

Closed twoeths closed 2 months ago

twoeths commented 2 months ago

Motivation

Similar to #7075 we should use fromHex instead of fromHexString because it has better performance on NodeJS

Description

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 77.96610% with 13 lines in your changes missing coverage. Please review.

Project coverage is 50.90%. Comparing base (9f4bf50) to head (ee8be5b). Report is 1 commits behind head on unstable.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## unstable #7080 +/- ## ============================================ - Coverage 50.91% 50.90% -0.01% ============================================ Files 594 594 Lines 39609 39611 +2 Branches 2245 2248 +3 ============================================ - Hits 20165 20163 -2 - Misses 19444 19448 +4 ```
github-actions[bot] commented 2 months ago

Performance Report

✔️ no performance regression detected

Full benchmark results | Benchmark suite | Current: d8f5949b5b392d96ea62116c82072d1433ee87b5 | Previous: 9f4bf50408fe51cf783a475ab6f0d2db40850753 | Ratio | |-|-|-|-| | getPubkeys - index2pubkey - req 1000 vs - 250000 vc | 1.8196 ms/op | 1.9364 ms/op | 0.94 | | getPubkeys - validatorsArr - req 1000 vs - 250000 vc | 40.058 us/op | 48.960 us/op | 0.82 | | BLS verify - blst | 938.05 us/op | 805.45 us/op | 1.16 | | BLS verifyMultipleSignatures 3 - blst | 1.3742 ms/op | 1.1810 ms/op | 1.16 | | BLS verifyMultipleSignatures 8 - blst | 2.1192 ms/op | 1.6455 ms/op | 1.29 | | BLS verifyMultipleSignatures 32 - blst | 4.4987 ms/op | 5.0024 ms/op | 0.90 | | BLS verifyMultipleSignatures 64 - blst | 8.3579 ms/op | 8.9849 ms/op | 0.93 | | BLS verifyMultipleSignatures 128 - blst | 15.990 ms/op | 17.353 ms/op | 0.92 | | BLS deserializing 10000 signatures | 615.43 ms/op | 669.27 ms/op | 0.92 | | BLS deserializing 100000 signatures | 6.2202 s/op | 6.7720 s/op | 0.92 | | BLS verifyMultipleSignatures - same message - 3 - blst | 763.64 us/op | 844.35 us/op | 0.90 | | BLS verifyMultipleSignatures - same message - 8 - blst | 1.0991 ms/op | 979.42 us/op | 1.12 | | BLS verifyMultipleSignatures - same message - 32 - blst | 1.7011 ms/op | 1.6479 ms/op | 1.03 | | BLS verifyMultipleSignatures - same message - 64 - blst | 2.5370 ms/op | 2.6162 ms/op | 0.97 | | BLS verifyMultipleSignatures - same message - 128 - blst | 3.9653 ms/op | 4.3060 ms/op | 0.92 | | BLS aggregatePubkeys 32 - blst | 18.613 us/op | 19.646 us/op | 0.95 | | BLS aggregatePubkeys 128 - blst | 67.038 us/op | 70.324 us/op | 0.95 | | notSeenSlots=1 numMissedVotes=1 numBadVotes=10 | 61.238 ms/op | 64.575 ms/op | 0.95 | | notSeenSlots=1 numMissedVotes=0 numBadVotes=4 | 45.464 ms/op | 48.076 ms/op | 0.95 | | notSeenSlots=2 numMissedVotes=1 numBadVotes=10 | 44.179 ms/op | 34.508 ms/op | 1.28 | | getSlashingsAndExits - default max | 77.611 us/op | 93.530 us/op | 0.83 | | getSlashingsAndExits - 2k | 235.37 us/op | 292.92 us/op | 0.80 | | proposeBlockBody type=full, size=empty | 4.7605 ms/op | 5.8352 ms/op | 0.82 | | isKnown best case - 1 super set check | 429.00 ns/op | 302.00 ns/op | 1.42 | | isKnown normal case - 2 super set checks | 402.00 ns/op | 288.00 ns/op | 1.40 | | isKnown worse case - 16 super set checks | 422.00 ns/op | 285.00 ns/op | 1.48 | | InMemoryCheckpointStateCache - add get delete | 3.3030 us/op | 3.4050 us/op | 0.97 | | updateUnfinalizedPubkeys - updating 10 pubkeys | 701.02 us/op | 826.53 us/op | 0.85 | | updateUnfinalizedPubkeys - updating 100 pubkeys | 2.7501 ms/op | 2.4728 ms/op | 1.11 | | updateUnfinalizedPubkeys - updating 1000 pubkeys | 37.347 ms/op | 52.359 ms/op | 0.71 | | validate api signedAggregateAndProof - struct | 1.8412 ms/op | 1.3601 ms/op | 1.35 | | validate gossip signedAggregateAndProof - struct | 1.9571 ms/op | 1.3440 ms/op | 1.46 | | validate gossip attestation - vc 640000 | 971.44 us/op | 863.10 us/op | 1.13 | | batch validate gossip attestation - vc 640000 - chunk 32 | 118.67 us/op | 129.50 us/op | 0.92 | | batch validate gossip attestation - vc 640000 - chunk 64 | 107.50 us/op | 116.68 us/op | 0.92 | | batch validate gossip attestation - vc 640000 - chunk 128 | 97.198 us/op | 103.25 us/op | 0.94 | | batch validate gossip attestation - vc 640000 - chunk 256 | 92.560 us/op | 100.30 us/op | 0.92 | | pickEth1Vote - no votes | 868.71 us/op | 1.2305 ms/op | 0.71 | | pickEth1Vote - max votes | 4.3169 ms/op | 5.6369 ms/op | 0.77 | | pickEth1Vote - Eth1Data hashTreeRoot value x2048 | 9.5584 ms/op | 11.885 ms/op | 0.80 | | pickEth1Vote - Eth1Data hashTreeRoot tree x2048 | 13.292 ms/op | 15.789 ms/op | 0.84 | | pickEth1Vote - Eth1Data fastSerialize value x2048 | 370.22 us/op | 500.39 us/op | 0.74 | | pickEth1Vote - Eth1Data fastSerialize tree x2048 | 1.9789 ms/op | 2.5484 ms/op | 0.78 | | bytes32 toHexString | 597.00 ns/op | 488.00 ns/op | 1.22 | | bytes32 Buffer.toString(hex) | 431.00 ns/op | 262.00 ns/op | 1.65 | | bytes32 Buffer.toString(hex) from Uint8Array | 519.00 ns/op | 387.00 ns/op | 1.34 | | bytes32 Buffer.toString(hex) + 0x | 441.00 ns/op | 259.00 ns/op | 1.70 | | Object access 1 prop | 0.31800 ns/op | 0.14100 ns/op | 2.26 | | Map access 1 prop | 0.33600 ns/op | 0.13500 ns/op | 2.49 | | Object get x1000 | 5.4020 ns/op | 5.8810 ns/op | 0.92 | | Map get x1000 | 6.0370 ns/op | 6.4980 ns/op | 0.93 | | Object set x1000 | 22.821 ns/op | 33.336 ns/op | 0.68 | | Map set x1000 | 18.932 ns/op | 22.371 ns/op | 0.85 | | Return object 10000 times | 0.29530 ns/op | 0.29300 ns/op | 1.01 | | Throw Error 10000 times | 2.6629 us/op | 3.3526 us/op | 0.79 | | toHex | 109.99 ns/op | 147.38 ns/op | 0.75 | | Buffer.from | 102.88 ns/op | 143.59 ns/op | 0.72 | | shared Buffer | 69.762 ns/op | 87.012 ns/op | 0.80 | | fastMsgIdFn sha256 / 200 bytes | 1.9810 us/op | 2.2020 us/op | 0.90 | | fastMsgIdFn h32 xxhash / 200 bytes | 443.00 ns/op | 236.00 ns/op | 1.88 | | fastMsgIdFn h64 xxhash / 200 bytes | 505.00 ns/op | 286.00 ns/op | 1.77 | | fastMsgIdFn sha256 / 1000 bytes | 5.9170 us/op | 7.6540 us/op | 0.77 | | fastMsgIdFn h32 xxhash / 1000 bytes | 514.00 ns/op | 419.00 ns/op | 1.23 | | fastMsgIdFn h64 xxhash / 1000 bytes | 546.00 ns/op | 360.00 ns/op | 1.52 | | fastMsgIdFn sha256 / 10000 bytes | 50.620 us/op | 66.776 us/op | 0.76 | | fastMsgIdFn h32 xxhash / 10000 bytes | 1.9670 us/op | 1.9630 us/op | 1.00 | | fastMsgIdFn h64 xxhash / 10000 bytes | 1.3360 us/op | 1.3020 us/op | 1.03 | | send data - 1000 256B messages | 10.363 ms/op | 14.317 ms/op | 0.72 | | send data - 1000 512B messages | 15.345 ms/op | 18.028 ms/op | 0.85 | | send data - 1000 1024B messages | 22.409 ms/op | 27.366 ms/op | 0.82 | | send data - 1000 1200B messages | 23.243 ms/op | 26.615 ms/op | 0.87 | | send data - 1000 2048B messages | 27.989 ms/op | 33.174 ms/op | 0.84 | | send data - 1000 4096B messages | 26.763 ms/op | 30.223 ms/op | 0.89 | | send data - 1000 16384B messages | 65.834 ms/op | 69.440 ms/op | 0.95 | | send data - 1000 65536B messages | 249.14 ms/op | 222.27 ms/op | 1.12 | | enrSubnets - fastDeserialize 64 bits | 1.2190 us/op | 1.2410 us/op | 0.98 | | enrSubnets - ssz BitVector 64 bits | 538.00 ns/op | 409.00 ns/op | 1.32 | | enrSubnets - fastDeserialize 4 bits | 366.00 ns/op | 190.00 ns/op | 1.93 | | enrSubnets - ssz BitVector 4 bits | 519.00 ns/op | 406.00 ns/op | 1.28 | | prioritizePeers score -10:0 att 32-0.1 sync 2-0 | 126.35 us/op | 136.18 us/op | 0.93 | | prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 | 128.05 us/op | 171.88 us/op | 0.75 | | prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 | 283.33 us/op | 280.94 us/op | 1.01 | | prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 | 476.09 us/op | 491.44 us/op | 0.97 | | prioritizePeers score 0:0 att 64-1 sync 4-1 | 893.25 us/op | 644.37 us/op | 1.39 | | array of 16000 items push then shift | 1.2955 us/op | 1.7049 us/op | 0.76 | | LinkedList of 16000 items push then shift | 9.2810 ns/op | 7.9350 ns/op | 1.17 | | array of 16000 items push then pop | 131.72 ns/op | 128.93 ns/op | 1.02 | | LinkedList of 16000 items push then pop | 6.9940 ns/op | 7.6870 ns/op | 0.91 | | array of 24000 items push then shift | 1.8924 us/op | 2.5203 us/op | 0.75 | | LinkedList of 24000 items push then shift | 7.2580 ns/op | 8.2490 ns/op | 0.88 | | array of 24000 items push then pop | 164.32 ns/op | 173.20 ns/op | 0.95 | | LinkedList of 24000 items push then pop | 6.6090 ns/op | 7.6850 ns/op | 0.86 | | intersect bitArray bitLen 8 | 5.5140 ns/op | 6.6620 ns/op | 0.83 | | intersect array and set length 8 | 40.251 ns/op | 48.636 ns/op | 0.83 | | intersect bitArray bitLen 128 | 26.646 ns/op | 30.802 ns/op | 0.87 | | intersect array and set length 128 | 590.96 ns/op | 712.93 ns/op | 0.83 | | bitArray.getTrueBitIndexes() bitLen 128 | 2.2430 us/op | 1.4680 us/op | 1.53 | | bitArray.getTrueBitIndexes() bitLen 248 | 4.1190 us/op | 2.4790 us/op | 1.66 | | bitArray.getTrueBitIndexes() bitLen 512 | 8.5810 us/op | 4.9460 us/op | 1.73 | | Buffer.concat 32 items | 1.1060 us/op | 1.0610 us/op | 1.04 | | Uint8Array.set 32 items | 1.7910 us/op | 2.0430 us/op | 0.88 | | Buffer.copy | 2.0320 us/op | 2.0910 us/op | 0.97 | | Uint8Array.set - with subarray | 2.5910 us/op | 2.6360 us/op | 0.98 | | Uint8Array.set - without subarray | 1.7870 us/op | 1.5120 us/op | 1.18 | | getUint32 - dataview | 417.00 ns/op | 241.00 ns/op | 1.73 | | getUint32 - manual | 383.00 ns/op | 162.00 ns/op | 2.36 | | Set add up to 64 items then delete first | 1.8011 us/op | 2.2243 us/op | 0.81 | | OrderedSet add up to 64 items then delete first | 3.1435 us/op | 3.5279 us/op | 0.89 | | Set add up to 64 items then delete last | 2.1951 us/op | 2.5685 us/op | 0.85 | | OrderedSet add up to 64 items then delete last | 3.0866 us/op | 3.8681 us/op | 0.80 | | Set add up to 64 items then delete middle | 2.0551 us/op | 2.5134 us/op | 0.82 | | OrderedSet add up to 64 items then delete middle | 4.5056 us/op | 5.3256 us/op | 0.85 | | Set add up to 128 items then delete first | 4.0173 us/op | 5.0916 us/op | 0.79 | | OrderedSet add up to 128 items then delete first | 6.2984 us/op | 7.8616 us/op | 0.80 | | Set add up to 128 items then delete last | 3.9634 us/op | 5.5099 us/op | 0.72 | | OrderedSet add up to 128 items then delete last | 5.9671 us/op | 9.3532 us/op | 0.64 | | Set add up to 128 items then delete middle | 3.9468 us/op | 5.6783 us/op | 0.70 | | OrderedSet add up to 128 items then delete middle | 11.769 us/op | 16.171 us/op | 0.73 | | Set add up to 256 items then delete first | 7.9772 us/op | 11.747 us/op | 0.68 | | OrderedSet add up to 256 items then delete first | 12.526 us/op | 18.396 us/op | 0.68 | | Set add up to 256 items then delete last | 7.8242 us/op | 11.787 us/op | 0.66 | | OrderedSet add up to 256 items then delete last | 12.042 us/op | 18.028 us/op | 0.67 | | Set add up to 256 items then delete middle | 7.7410 us/op | 11.730 us/op | 0.66 | | OrderedSet add up to 256 items then delete middle | 35.163 us/op | 44.353 us/op | 0.79 | | transfer serialized Status (84 B) | 1.7290 us/op | 1.7090 us/op | 1.01 | | copy serialized Status (84 B) | 1.3280 us/op | 1.3490 us/op | 0.98 | | transfer serialized SignedVoluntaryExit (112 B) | 1.6290 us/op | 1.6620 us/op | 0.98 | | copy serialized SignedVoluntaryExit (112 B) | 1.4240 us/op | 1.3580 us/op | 1.05 | | transfer serialized ProposerSlashing (416 B) | 2.2760 us/op | 2.2520 us/op | 1.01 | | copy serialized ProposerSlashing (416 B) | 2.2310 us/op | 1.9560 us/op | 1.14 | | transfer serialized Attestation (485 B) | 2.3350 us/op | 2.2400 us/op | 1.04 | | copy serialized Attestation (485 B) | 2.2430 us/op | 1.8100 us/op | 1.24 | | transfer serialized AttesterSlashing (33232 B) | 1.9190 us/op | 2.6650 us/op | 0.72 | | copy serialized AttesterSlashing (33232 B) | 4.2850 us/op | 6.3300 us/op | 0.68 | | transfer serialized Small SignedBeaconBlock (128000 B) | 3.1170 us/op | 3.1810 us/op | 0.98 | | copy serialized Small SignedBeaconBlock (128000 B) | 14.569 us/op | 18.224 us/op | 0.80 | | transfer serialized Avg SignedBeaconBlock (200000 B) | 2.7340 us/op | 3.4930 us/op | 0.78 | | copy serialized Avg SignedBeaconBlock (200000 B) | 12.778 us/op | 21.005 us/op | 0.61 | | transfer serialized BlobsSidecar (524380 B) | 2.4960 us/op | 2.6920 us/op | 0.93 | | copy serialized BlobsSidecar (524380 B) | 114.71 us/op | 82.152 us/op | 1.40 | | transfer serialized Big SignedBeaconBlock (1000000 B) | 3.0890 us/op | 3.1970 us/op | 0.97 | | copy serialized Big SignedBeaconBlock (1000000 B) | 393.84 us/op | 151.67 us/op | 2.60 | | pass gossip attestations to forkchoice per slot | 2.5902 ms/op | 2.8688 ms/op | 0.90 | | forkChoice updateHead vc 100000 bc 64 eq 0 | 602.39 us/op | 506.48 us/op | 1.19 | | forkChoice updateHead vc 600000 bc 64 eq 0 | 2.5668 ms/op | 3.1326 ms/op | 0.82 | | forkChoice updateHead vc 1000000 bc 64 eq 0 | 4.2165 ms/op | 5.3411 ms/op | 0.79 | | forkChoice updateHead vc 600000 bc 320 eq 0 | 2.5961 ms/op | 3.0190 ms/op | 0.86 | | forkChoice updateHead vc 600000 bc 1200 eq 0 | 2.5073 ms/op | 3.1076 ms/op | 0.81 | | forkChoice updateHead vc 600000 bc 7200 eq 0 | 2.8560 ms/op | 4.1114 ms/op | 0.69 | | forkChoice updateHead vc 600000 bc 64 eq 1000 | 9.1988 ms/op | 10.639 ms/op | 0.86 | | forkChoice updateHead vc 600000 bc 64 eq 10000 | 9.4727 ms/op | 10.974 ms/op | 0.86 | | forkChoice updateHead vc 600000 bc 64 eq 300000 | 10.989 ms/op | 14.654 ms/op | 0.75 | | computeDeltas 500000 validators 300 proto nodes | 2.9222 ms/op | 3.4707 ms/op | 0.84 | | computeDeltas 500000 validators 1200 proto nodes | 3.1052 ms/op | 3.4643 ms/op | 0.90 | | computeDeltas 500000 validators 7200 proto nodes | 3.1979 ms/op | 3.5337 ms/op | 0.90 | | computeDeltas 750000 validators 300 proto nodes | 4.7620 ms/op | 5.3136 ms/op | 0.90 | | computeDeltas 750000 validators 1200 proto nodes | 4.5022 ms/op | 5.4108 ms/op | 0.83 | | computeDeltas 750000 validators 7200 proto nodes | 4.5956 ms/op | 5.5632 ms/op | 0.83 | | computeDeltas 1400000 validators 300 proto nodes | 8.5188 ms/op | 10.353 ms/op | 0.82 | | computeDeltas 1400000 validators 1200 proto nodes | 8.6546 ms/op | 10.382 ms/op | 0.83 | | computeDeltas 1400000 validators 7200 proto nodes | 8.7227 ms/op | 10.620 ms/op | 0.82 | | computeDeltas 2100000 validators 300 proto nodes | 12.757 ms/op | 15.625 ms/op | 0.82 | | computeDeltas 2100000 validators 1200 proto nodes | 12.633 ms/op | 15.555 ms/op | 0.81 | | computeDeltas 2100000 validators 7200 proto nodes | 12.825 ms/op | 15.341 ms/op | 0.84 | | altair processAttestation - 250000 vs - 7PWei normalcase | 1.7193 ms/op | 1.7494 ms/op | 0.98 | | altair processAttestation - 250000 vs - 7PWei worstcase | 2.2692 ms/op | 2.4926 ms/op | 0.91 | | altair processAttestation - setStatus - 1/6 committees join | 89.103 us/op | 120.73 us/op | 0.74 | | altair processAttestation - setStatus - 1/3 committees join | 149.47 us/op | 229.50 us/op | 0.65 | | altair processAttestation - setStatus - 1/2 committees join | 209.84 us/op | 322.10 us/op | 0.65 | | altair processAttestation - setStatus - 2/3 committees join | 300.22 us/op | 418.65 us/op | 0.72 | | altair processAttestation - setStatus - 4/5 committees join | 451.99 us/op | 576.00 us/op | 0.78 | | altair processAttestation - setStatus - 100% committees join | 528.69 us/op | 682.94 us/op | 0.77 | | altair processBlock - 250000 vs - 7PWei normalcase | 3.9781 ms/op | 5.3781 ms/op | 0.74 | | altair processBlock - 250000 vs - 7PWei normalcase hashState | 26.501 ms/op | 26.663 ms/op | 0.99 | | altair processBlock - 250000 vs - 7PWei worstcase | 37.558 ms/op | 36.182 ms/op | 1.04 | | altair processBlock - 250000 vs - 7PWei worstcase hashState | 74.927 ms/op | 73.196 ms/op | 1.02 | | phase0 processBlock - 250000 vs - 7PWei normalcase | 2.0906 ms/op | 2.0994 ms/op | 1.00 | | phase0 processBlock - 250000 vs - 7PWei worstcase | 23.741 ms/op | 22.531 ms/op | 1.05 | | altair processEth1Data - 250000 vs - 7PWei normalcase | 262.96 us/op | 341.37 us/op | 0.77 | | getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 | 5.9170 us/op | 6.4940 us/op | 0.91 | | getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 | 30.127 us/op | 41.964 us/op | 0.72 | | getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 | 10.850 us/op | 11.262 us/op | 0.96 | | getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 | 7.7900 us/op | 7.1180 us/op | 1.09 | | getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 | 125.77 us/op | 140.57 us/op | 0.89 | | getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 | 1.0417 ms/op | 1.1039 ms/op | 0.94 | | getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 | 1.1307 ms/op | 1.5439 ms/op | 0.73 | | getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 | 1.4348 ms/op | 1.6708 ms/op | 0.86 | | getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 | 2.8629 ms/op | 3.6627 ms/op | 0.78 | | getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 | 1.2064 ms/op | 1.5562 ms/op | 0.78 | | getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 | 3.2413 ms/op | 3.7321 ms/op | 0.87 | | Tree 40 250000 create | 188.54 ms/op | 214.38 ms/op | 0.88 | | Tree 40 250000 get(125000) | 111.50 ns/op | 147.22 ns/op | 0.76 | | Tree 40 250000 set(125000) | 546.96 ns/op | 682.40 ns/op | 0.80 | | Tree 40 250000 toArray() | 17.630 ms/op | 15.357 ms/op | 1.15 | | Tree 40 250000 iterate all - toArray() + loop | 19.071 ms/op | 16.239 ms/op | 1.17 | | Tree 40 250000 iterate all - get(i) | 45.457 ms/op | 51.350 ms/op | 0.89 | | Array 250000 create | 3.1758 ms/op | 3.0161 ms/op | 1.05 | | Array 250000 clone - spread | 1.2331 ms/op | 1.4969 ms/op | 0.82 | | Array 250000 get(125000) | 0.57400 ns/op | 0.42300 ns/op | 1.36 | | Array 250000 set(125000) | 0.58900 ns/op | 0.44600 ns/op | 1.32 | | Array 250000 iterate all - loop | 76.560 us/op | 104.84 us/op | 0.73 | | phase0 afterProcessEpoch - 250000 vs - 7PWei | 82.460 ms/op | 88.175 ms/op | 0.94 | | Array.fill - length 1000000 | 2.6855 ms/op | 3.7275 ms/op | 0.72 | | Array push - length 1000000 | 23.795 ms/op | 17.337 ms/op | 1.37 | | Array.get | 0.27256 ns/op | 0.28882 ns/op | 0.94 | | Uint8Array.get | 0.36130 ns/op | 0.44660 ns/op | 0.81 | | phase0 beforeProcessEpoch - 250000 vs - 7PWei | 19.573 ms/op | 15.695 ms/op | 1.25 | | altair processEpoch - mainnet_e81889 | 323.05 ms/op | 313.42 ms/op | 1.03 | | mainnet_e81889 - altair beforeProcessEpoch | 19.248 ms/op | 18.112 ms/op | 1.06 | | mainnet_e81889 - altair processJustificationAndFinalization | 15.786 us/op | 13.471 us/op | 1.17 | | mainnet_e81889 - altair processInactivityUpdates | 4.5534 ms/op | 5.8952 ms/op | 0.77 | | mainnet_e81889 - altair processRewardsAndPenalties | 43.861 ms/op | 48.276 ms/op | 0.91 | | mainnet_e81889 - altair processRegistryUpdates | 2.9250 us/op | 1.5090 us/op | 1.94 | | mainnet_e81889 - altair processSlashings | 979.00 ns/op | 339.00 ns/op | 2.89 | | mainnet_e81889 - altair processEth1DataReset | 821.00 ns/op | 295.00 ns/op | 2.78 | | mainnet_e81889 - altair processEffectiveBalanceUpdates | 1.3278 ms/op | 1.4401 ms/op | 0.92 | | mainnet_e81889 - altair processSlashingsReset | 4.5260 us/op | 2.7620 us/op | 1.64 | | mainnet_e81889 - altair processRandaoMixesReset | 9.4120 us/op | 4.7080 us/op | 2.00 | | mainnet_e81889 - altair processHistoricalRootsUpdate | 1.1600 us/op | 512.00 ns/op | 2.27 | | mainnet_e81889 - altair processParticipationFlagUpdates | 5.0580 us/op | 1.9150 us/op | 2.64 | | mainnet_e81889 - altair processSyncCommitteeUpdates | 1.1990 us/op | 403.00 ns/op | 2.98 | | mainnet_e81889 - altair afterProcessEpoch | 89.754 ms/op | 93.687 ms/op | 0.96 | | capella processEpoch - mainnet_e217614 | 1.6506 s/op | 1.0977 s/op | 1.50 | | mainnet_e217614 - capella beforeProcessEpoch | 105.56 ms/op | 74.170 ms/op | 1.42 | | mainnet_e217614 - capella processJustificationAndFinalization | 28.461 us/op | 14.765 us/op | 1.93 | | mainnet_e217614 - capella processInactivityUpdates | 25.492 ms/op | 18.181 ms/op | 1.40 | | mainnet_e217614 - capella processRewardsAndPenalties | 314.04 ms/op | 230.15 ms/op | 1.36 | | mainnet_e217614 - capella processRegistryUpdates | 18.940 us/op | 15.007 us/op | 1.26 | | mainnet_e217614 - capella processSlashings | 1.0820 us/op | 554.00 ns/op | 1.95 | | mainnet_e217614 - capella processEth1DataReset | 911.00 ns/op | 889.00 ns/op | 1.02 | | mainnet_e217614 - capella processEffectiveBalanceUpdates | 19.834 ms/op | 13.767 ms/op | 1.44 | | mainnet_e217614 - capella processSlashingsReset | 7.5870 us/op | 3.4370 us/op | 2.21 | | mainnet_e217614 - capella processRandaoMixesReset | 8.2480 us/op | 4.0070 us/op | 2.06 | | mainnet_e217614 - capella processHistoricalRootsUpdate | 1.0740 us/op | 494.00 ns/op | 2.17 | | mainnet_e217614 - capella processParticipationFlagUpdates | 4.4530 us/op | 2.2970 us/op | 1.94 | | mainnet_e217614 - capella afterProcessEpoch | 245.27 ms/op | 238.69 ms/op | 1.03 | | phase0 processEpoch - mainnet_e58758 | 399.05 ms/op | 411.01 ms/op | 0.97 | | mainnet_e58758 - phase0 beforeProcessEpoch | 92.940 ms/op | 84.230 ms/op | 1.10 | | mainnet_e58758 - phase0 processJustificationAndFinalization | 20.330 us/op | 14.728 us/op | 1.38 | | mainnet_e58758 - phase0 processRewardsAndPenalties | 28.899 ms/op | 27.491 ms/op | 1.05 | | mainnet_e58758 - phase0 processRegistryUpdates | 7.4750 us/op | 8.5110 us/op | 0.88 | | mainnet_e58758 - phase0 processSlashings | 838.00 ns/op | 318.00 ns/op | 2.64 | | mainnet_e58758 - phase0 processEth1DataReset | 804.00 ns/op | 390.00 ns/op | 2.06 | | mainnet_e58758 - phase0 processEffectiveBalanceUpdates | 2.1387 ms/op | 1.2332 ms/op | 1.73 | | mainnet_e58758 - phase0 processSlashingsReset | 4.7600 us/op | 3.4170 us/op | 1.39 | | mainnet_e58758 - phase0 processRandaoMixesReset | 5.5550 us/op | 5.1780 us/op | 1.07 | | mainnet_e58758 - phase0 processHistoricalRootsUpdate | 702.00 ns/op | 427.00 ns/op | 1.64 | | mainnet_e58758 - phase0 processParticipationRecordUpdates | 5.4480 us/op | 4.8690 us/op | 1.12 | | mainnet_e58758 - phase0 afterProcessEpoch | 67.967 ms/op | 80.569 ms/op | 0.84 | | phase0 processEffectiveBalanceUpdates - 250000 normalcase | 1.0305 ms/op | 1.9476 ms/op | 0.53 | | phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 | 1.6096 ms/op | 2.4929 ms/op | 0.65 | | altair processInactivityUpdates - 250000 normalcase | 16.099 ms/op | 16.290 ms/op | 0.99 | | altair processInactivityUpdates - 250000 worstcase | 17.220 ms/op | 16.121 ms/op | 1.07 | | phase0 processRegistryUpdates - 250000 normalcase | 7.2210 us/op | 7.8000 us/op | 0.93 | | phase0 processRegistryUpdates - 250000 badcase_full_deposits | 330.83 us/op | 297.38 us/op | 1.11 | | phase0 processRegistryUpdates - 250000 worstcase 0.5 | 117.49 ms/op | 138.23 ms/op | 0.85 | | altair processRewardsAndPenalties - 250000 normalcase | 46.871 ms/op | 42.776 ms/op | 1.10 | | altair processRewardsAndPenalties - 250000 worstcase | 40.765 ms/op | 36.218 ms/op | 1.13 | | phase0 getAttestationDeltas - 250000 normalcase | 7.1052 ms/op | 9.2782 ms/op | 0.77 | | phase0 getAttestationDeltas - 250000 worstcase | 6.6281 ms/op | 9.8792 ms/op | 0.67 | | phase0 processSlashings - 250000 worstcase | 92.955 us/op | 115.41 us/op | 0.81 | | altair processSyncCommitteeUpdates - 250000 | 106.51 ms/op | 141.43 ms/op | 0.75 | | BeaconState.hashTreeRoot - No change | 580.00 ns/op | 398.00 ns/op | 1.46 | | BeaconState.hashTreeRoot - 1 full validator | 81.390 us/op | 144.96 us/op | 0.56 | | BeaconState.hashTreeRoot - 32 full validator | 1.4708 ms/op | 1.2257 ms/op | 1.20 | | BeaconState.hashTreeRoot - 512 full validator | 10.555 ms/op | 11.819 ms/op | 0.89 | | BeaconState.hashTreeRoot - 1 validator.effectiveBalance | 107.56 us/op | 140.06 us/op | 0.77 | | BeaconState.hashTreeRoot - 32 validator.effectiveBalance | 1.6412 ms/op | 1.8038 ms/op | 0.91 | | BeaconState.hashTreeRoot - 512 validator.effectiveBalance | 23.308 ms/op | 21.443 ms/op | 1.09 | | BeaconState.hashTreeRoot - 1 balances | 90.511 us/op | 92.371 us/op | 0.98 | | BeaconState.hashTreeRoot - 32 balances | 815.44 us/op | 1.1757 ms/op | 0.69 | | BeaconState.hashTreeRoot - 512 balances | 8.0114 ms/op | 9.4173 ms/op | 0.85 | | BeaconState.hashTreeRoot - 250000 balances | 190.56 ms/op | 166.87 ms/op | 1.14 | | aggregationBits - 2048 els - zipIndexesInBitList | 25.102 us/op | 33.097 us/op | 0.76 | | byteArrayEquals 32 | 46.512 ns/op | 55.632 ns/op | 0.84 | | Buffer.compare 32 | 15.049 ns/op | 17.762 ns/op | 0.85 | | byteArrayEquals 1024 | 1.2432 us/op | 1.6427 us/op | 0.76 | | Buffer.compare 1024 | 22.254 ns/op | 26.809 ns/op | 0.83 | | byteArrayEquals 16384 | 19.948 us/op | 26.061 us/op | 0.77 | | Buffer.compare 16384 | 166.59 ns/op | 207.67 ns/op | 0.80 | | byteArrayEquals 123687377 | 153.72 ms/op | 199.40 ms/op | 0.77 | | Buffer.compare 123687377 | 5.2394 ms/op | 9.3264 ms/op | 0.56 | | byteArrayEquals 32 - diff last byte | 47.325 ns/op | 55.527 ns/op | 0.85 | | Buffer.compare 32 - diff last byte | 16.698 ns/op | 18.448 ns/op | 0.91 | | byteArrayEquals 1024 - diff last byte | 1.2532 us/op | 1.6485 us/op | 0.76 | | Buffer.compare 1024 - diff last byte | 24.855 ns/op | 27.825 ns/op | 0.89 | | byteArrayEquals 16384 - diff last byte | 19.945 us/op | 26.178 us/op | 0.76 | | Buffer.compare 16384 - diff last byte | 177.94 ns/op | 215.10 ns/op | 0.83 | | byteArrayEquals 123687377 - diff last byte | 151.55 ms/op | 194.64 ms/op | 0.78 | | Buffer.compare 123687377 - diff last byte | 4.4566 ms/op | 7.6676 ms/op | 0.58 | | byteArrayEquals 32 - random bytes | 5.0790 ns/op | 5.3040 ns/op | 0.96 | | Buffer.compare 32 - random bytes | 16.400 ns/op | 17.651 ns/op | 0.93 | | byteArrayEquals 1024 - random bytes | 4.9610 ns/op | 5.2930 ns/op | 0.94 | | Buffer.compare 1024 - random bytes | 16.138 ns/op | 17.578 ns/op | 0.92 | | byteArrayEquals 16384 - random bytes | 5.0010 ns/op | 5.2650 ns/op | 0.95 | | Buffer.compare 16384 - random bytes | 16.058 ns/op | 17.680 ns/op | 0.91 | | byteArrayEquals 123687377 - random bytes | 7.8600 ns/op | 6.5900 ns/op | 1.19 | | Buffer.compare 123687377 - random bytes | 19.240 ns/op | 19.010 ns/op | 1.01 | | regular array get 100000 times | 31.329 us/op | 33.968 us/op | 0.92 | | wrappedArray get 100000 times | 31.659 us/op | 33.621 us/op | 0.94 | | arrayWithProxy get 100000 times | 11.090 ms/op | 13.782 ms/op | 0.80 | | ssz.Root.equals | 46.314 ns/op | 46.833 ns/op | 0.99 | | byteArrayEquals | 43.608 ns/op | 46.135 ns/op | 0.95 | | Buffer.compare | 9.1140 ns/op | 10.686 ns/op | 0.85 | | shuffle list - 16384 els | 5.5953 ms/op | 6.3543 ms/op | 0.88 | | shuffle list - 250000 els | 82.086 ms/op | 94.063 ms/op | 0.87 | | processSlot - 1 slots | 14.357 us/op | 12.774 us/op | 1.12 | | processSlot - 32 slots | 3.9000 ms/op | 2.2818 ms/op | 1.71 | | getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei | 35.160 ms/op | 35.045 ms/op | 1.00 | | getCommitteeAssignments - req 1 vs - 250000 vc | 1.8175 ms/op | 2.1612 ms/op | 0.84 | | getCommitteeAssignments - req 100 vs - 250000 vc | 3.5853 ms/op | 4.1395 ms/op | 0.87 | | getCommitteeAssignments - req 1000 vs - 250000 vc | 3.8101 ms/op | 4.4041 ms/op | 0.87 | | findModifiedValidators - 10000 modified validators | 270.21 ms/op | 244.53 ms/op | 1.11 | | findModifiedValidators - 1000 modified validators | 187.30 ms/op | 159.62 ms/op | 1.17 | | findModifiedValidators - 100 modified validators | 177.14 ms/op | 152.88 ms/op | 1.16 | | findModifiedValidators - 10 modified validators | 216.45 ms/op | 159.87 ms/op | 1.35 | | findModifiedValidators - 1 modified validators | 241.11 ms/op | 172.03 ms/op | 1.40 | | findModifiedValidators - no difference | 245.95 ms/op | 173.48 ms/op | 1.42 | | compare ViewDUs | 4.0388 s/op | 2.9980 s/op | 1.35 | | compare each validator Uint8Array | 1.6271 s/op | 1.3572 s/op | 1.20 | | compare ViewDU to Uint8Array | 818.21 ms/op | 987.41 ms/op | 0.83 | | migrate state 1000000 validators, 24 modified, 0 new | 538.84 ms/op | 599.99 ms/op | 0.90 | | migrate state 1000000 validators, 1700 modified, 1000 new | 802.73 ms/op | 812.92 ms/op | 0.99 | | migrate state 1000000 validators, 3400 modified, 2000 new | 1.0296 s/op | 998.36 ms/op | 1.03 | | migrate state 1500000 validators, 24 modified, 0 new | 598.59 ms/op | 601.39 ms/op | 1.00 | | migrate state 1500000 validators, 1700 modified, 1000 new | 828.84 ms/op | 839.63 ms/op | 0.99 | | migrate state 1500000 validators, 3400 modified, 2000 new | 1.0821 s/op | 943.46 ms/op | 1.15 | | RootCache.getBlockRootAtSlot - 250000 vs - 7PWei | 5.9300 ns/op | 4.6500 ns/op | 1.28 | | state getBlockRootAtSlot - 250000 vs - 7PWei | 404.58 ns/op | 606.87 ns/op | 0.67 | | computeProposers - vc 250000 | 6.1613 ms/op | 7.8766 ms/op | 0.78 | | computeEpochShuffling - vc 250000 | 82.656 ms/op | 94.702 ms/op | 0.87 | | getNextSyncCommittee - vc 250000 | 110.30 ms/op | 123.95 ms/op | 0.89 | | computeSigningRoot for AttestationData | 23.200 us/op | 19.862 us/op | 1.17 | | hash AttestationData serialized data then Buffer.toString(base64) | 1.2022 us/op | 1.5693 us/op | 0.77 | | toHexString serialized data | 741.69 ns/op | 890.36 ns/op | 0.83 | | Buffer.toString(base64) | 141.82 ns/op | 175.00 ns/op | 0.81 | | nodejs block root to RootHex using toHex | 114.64 ns/op | 148.61 ns/op | 0.77 | | nodejs block root to RootHex using toRootHex | 76.226 ns/op | 97.460 ns/op | 0.78 | | browser block root to RootHex using the deprecated toHexString | 210.55 ns/op | 232.32 ns/op | 0.91 | | browser block root to RootHex using toHex | 167.44 ns/op | 186.38 ns/op | 0.90 | | browser block root to RootHex using toRootHex | 145.52 ns/op | 164.45 ns/op | 0.88 |

by benchmarkbot/action

twoeths commented 2 months ago

spec test is failing

twoeths commented 2 months ago

the deneb simtest passed

wemeetagain commented 1 week ago

:tada: This PR is included in v1.23.0 :tada: