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

chore: avoid using bigint for metrics #5926

Merged
merged 2 commits into from
Sep 12, 2023

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Sep 1, 2023

Motivation

We don't want to use bigint if we can since it causes us memory

Description

  • use timer api of prom-client (which then use process.hrtime())
  • so the result is still precise at nanoseconds level but we use number instead of bigint

part of #5892

@twoeths twoeths requested a review from a team as a code owner September 1, 2023 08:37
@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 8368972 Previous: 4dcbbb7 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 736.60 us/op 877.98 us/op 0.84
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 76.280 us/op 77.358 us/op 0.99
BLS verify - blst-native 1.2855 ms/op 1.2940 ms/op 0.99
BLS verifyMultipleSignatures 3 - blst-native 2.6959 ms/op 2.7208 ms/op 0.99
BLS verifyMultipleSignatures 8 - blst-native 5.8995 ms/op 5.9759 ms/op 0.99
BLS verifyMultipleSignatures 32 - blst-native 21.554 ms/op 21.935 ms/op 0.98
BLS verifyMultipleSignatures 64 - blst-native 42.522 ms/op 42.975 ms/op 0.99
BLS verifyMultipleSignatures 128 - blst-native 84.336 ms/op 85.579 ms/op 0.99
BLS deserializing 10000 signatures 873.55 ms/op 887.97 ms/op 0.98
BLS deserializing 100000 signatures 8.8616 s/op 8.7645 s/op 1.01
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.4122 ms/op 1.2809 ms/op 1.10
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.5127 ms/op 1.4411 ms/op 1.05
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.3233 ms/op 2.4214 ms/op 0.96
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.8124 ms/op 3.6242 ms/op 1.05
BLS verifyMultipleSignatures - same message - 128 - blst-native 5.6020 ms/op 5.4593 ms/op 1.03
BLS aggregatePubkeys 32 - blst-native 26.974 us/op 24.924 us/op 1.08
BLS aggregatePubkeys 128 - blst-native 99.813 us/op 95.962 us/op 1.04
getAttestationsForBlock 35.765 ms/op 38.008 ms/op 0.94
isKnown best case - 1 super set check 249.00 ns/op 268.00 ns/op 0.93
isKnown normal case - 2 super set checks 252.00 ns/op 259.00 ns/op 0.97
isKnown worse case - 16 super set checks 249.00 ns/op 251.00 ns/op 0.99
CheckpointStateCache - add get delete 4.5570 us/op 4.8350 us/op 0.94
validate api signedAggregateAndProof - struct 2.6362 ms/op 2.7223 ms/op 0.97
validate gossip signedAggregateAndProof - struct 2.6418 ms/op 2.6623 ms/op 0.99
validate gossip attestation - vc 640000 1.2933 ms/op 1.2994 ms/op 1.00
batch validate gossip attestation - vc 640000 - chunk 32 154.66 us/op 151.06 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 64 137.23 us/op 134.36 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 128 126.46 us/op 126.96 us/op 1.00
batch validate gossip attestation - vc 640000 - chunk 256 123.29 us/op 123.54 us/op 1.00
pickEth1Vote - no votes 1.1991 ms/op 1.1249 ms/op 1.07
pickEth1Vote - max votes 8.9384 ms/op 12.128 ms/op 0.74
pickEth1Vote - Eth1Data hashTreeRoot value x2048 17.913 ms/op 21.344 ms/op 0.84
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 28.292 ms/op 24.259 ms/op 1.17
pickEth1Vote - Eth1Data fastSerialize value x2048 545.75 us/op 556.14 us/op 0.98
pickEth1Vote - Eth1Data fastSerialize tree x2048 6.8585 ms/op 7.2747 ms/op 0.94
bytes32 toHexString 479.00 ns/op 444.00 ns/op 1.08
bytes32 Buffer.toString(hex) 304.00 ns/op 284.00 ns/op 1.07
bytes32 Buffer.toString(hex) from Uint8Array 460.00 ns/op 408.00 ns/op 1.13
bytes32 Buffer.toString(hex) + 0x 306.00 ns/op 279.00 ns/op 1.10
Object access 1 prop 0.17100 ns/op 0.14300 ns/op 1.20
Map access 1 prop 0.17100 ns/op 0.13900 ns/op 1.23
Object get x1000 7.4750 ns/op 7.4460 ns/op 1.00
Map get x1000 0.60400 ns/op 0.56000 ns/op 1.08
Object set x1000 48.097 ns/op 44.248 ns/op 1.09
Map set x1000 37.540 ns/op 34.967 ns/op 1.07
Return object 10000 times 0.22930 ns/op 0.21760 ns/op 1.05
Throw Error 10000 times 3.7520 us/op 3.6812 us/op 1.02
fastMsgIdFn sha256 / 200 bytes 3.3120 us/op 3.0680 us/op 1.08
fastMsgIdFn h32 xxhash / 200 bytes 258.00 ns/op 244.00 ns/op 1.06
fastMsgIdFn h64 xxhash / 200 bytes 321.00 ns/op 305.00 ns/op 1.05
fastMsgIdFn sha256 / 1000 bytes 11.383 us/op 10.565 us/op 1.08
fastMsgIdFn h32 xxhash / 1000 bytes 378.00 ns/op 356.00 ns/op 1.06
fastMsgIdFn h64 xxhash / 1000 bytes 392.00 ns/op 372.00 ns/op 1.05
fastMsgIdFn sha256 / 10000 bytes 103.97 us/op 96.363 us/op 1.08
fastMsgIdFn h32 xxhash / 10000 bytes 1.8430 us/op 1.7790 us/op 1.04
fastMsgIdFn h64 xxhash / 10000 bytes 1.2810 us/op 1.2220 us/op 1.05
enrSubnets - fastDeserialize 64 bits 1.1500 us/op 1.1370 us/op 1.01
enrSubnets - ssz BitVector 64 bits 403.00 ns/op 403.00 ns/op 1.00
enrSubnets - fastDeserialize 4 bits 153.00 ns/op 171.00 ns/op 0.89
enrSubnets - ssz BitVector 4 bits 403.00 ns/op 389.00 ns/op 1.04
prioritizePeers score -10:0 att 32-0.1 sync 2-0 97.752 us/op 95.029 us/op 1.03
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 121.09 us/op 121.74 us/op 0.99
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 152.59 us/op 153.22 us/op 1.00
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 279.35 us/op 269.52 us/op 1.04
prioritizePeers score 0:0 att 64-1 sync 4-1 332.89 us/op 320.23 us/op 1.04
array of 16000 items push then shift 1.6295 us/op 1.5612 us/op 1.04
LinkedList of 16000 items push then shift 8.9200 ns/op 8.6130 ns/op 1.04
array of 16000 items push then pop 70.591 ns/op 72.354 ns/op 0.98
LinkedList of 16000 items push then pop 8.7470 ns/op 8.3450 ns/op 1.05
array of 24000 items push then shift 2.3860 us/op 2.3014 us/op 1.04
LinkedList of 24000 items push then shift 8.9190 ns/op 8.6400 ns/op 1.03
array of 24000 items push then pop 92.534 ns/op 94.261 ns/op 0.98
LinkedList of 24000 items push then pop 8.6950 ns/op 8.4260 ns/op 1.03
intersect bitArray bitLen 8 7.7160 ns/op 6.5850 ns/op 1.17
intersect array and set length 8 53.924 ns/op 53.808 ns/op 1.00
intersect bitArray bitLen 128 32.306 ns/op 31.104 ns/op 1.04
intersect array and set length 128 743.63 ns/op 732.30 ns/op 1.02
bitArray.getTrueBitIndexes() bitLen 128 1.4720 us/op 1.4030 us/op 1.05
bitArray.getTrueBitIndexes() bitLen 248 2.4760 us/op 2.3980 us/op 1.03
bitArray.getTrueBitIndexes() bitLen 512 4.6820 us/op 4.7920 us/op 0.98
Buffer.concat 32 items 956.00 ns/op 1.0140 us/op 0.94
Uint8Array.set 32 items 1.7000 us/op 2.0530 us/op 0.83
Set add up to 64 items then delete first 4.1845 us/op 4.9264 us/op 0.85
OrderedSet add up to 64 items then delete first 5.3362 us/op 5.9832 us/op 0.89
Set add up to 64 items then delete last 4.3615 us/op 4.6031 us/op 0.95
OrderedSet add up to 64 items then delete last 5.8747 us/op 5.6327 us/op 1.04
Set add up to 64 items then delete middle 4.6357 us/op 4.5832 us/op 1.01
OrderedSet add up to 64 items then delete middle 7.2279 us/op 6.9845 us/op 1.03
Set add up to 128 items then delete first 8.9214 us/op 9.1651 us/op 0.97
OrderedSet add up to 128 items then delete first 11.251 us/op 12.047 us/op 0.93
Set add up to 128 items then delete last 8.9581 us/op 8.7393 us/op 1.03
OrderedSet add up to 128 items then delete last 11.855 us/op 10.998 us/op 1.08
Set add up to 128 items then delete middle 8.8674 us/op 9.1181 us/op 0.97
OrderedSet add up to 128 items then delete middle 16.769 us/op 16.729 us/op 1.00
Set add up to 256 items then delete first 17.683 us/op 18.742 us/op 0.94
OrderedSet add up to 256 items then delete first 22.652 us/op 24.719 us/op 0.92
Set add up to 256 items then delete last 17.891 us/op 18.221 us/op 0.98
OrderedSet add up to 256 items then delete last 23.814 us/op 22.903 us/op 1.04
Set add up to 256 items then delete middle 18.409 us/op 17.842 us/op 1.03
OrderedSet add up to 256 items then delete middle 45.352 us/op 44.263 us/op 1.02
transfer serialized Status (84 B) 1.8400 us/op 1.8390 us/op 1.00
copy serialized Status (84 B) 1.5170 us/op 1.5450 us/op 0.98
transfer serialized SignedVoluntaryExit (112 B) 1.9540 us/op 1.9030 us/op 1.03
copy serialized SignedVoluntaryExit (112 B) 1.5980 us/op 1.5990 us/op 1.00
transfer serialized ProposerSlashing (416 B) 2.5270 us/op 2.1160 us/op 1.19
copy serialized ProposerSlashing (416 B) 2.1790 us/op 1.8890 us/op 1.15
transfer serialized Attestation (485 B) 2.7920 us/op 2.1320 us/op 1.31
copy serialized Attestation (485 B) 2.3080 us/op 1.8740 us/op 1.23
transfer serialized AttesterSlashing (33232 B) 2.4290 us/op 2.2270 us/op 1.09
copy serialized AttesterSlashing (33232 B) 6.0050 us/op 4.9020 us/op 1.23
transfer serialized Small SignedBeaconBlock (128000 B) 2.6570 us/op 2.4630 us/op 1.08
copy serialized Small SignedBeaconBlock (128000 B) 13.605 us/op 12.200 us/op 1.12
transfer serialized Avg SignedBeaconBlock (200000 B) 2.8940 us/op 2.7980 us/op 1.03
copy serialized Avg SignedBeaconBlock (200000 B) 18.520 us/op 18.442 us/op 1.00
transfer serialized BlobsSidecar (524380 B) 2.9130 us/op 3.1310 us/op 0.93
copy serialized BlobsSidecar (524380 B) 74.707 us/op 73.981 us/op 1.01
transfer serialized Big SignedBeaconBlock (1000000 B) 2.9320 us/op 3.1240 us/op 0.94
copy serialized Big SignedBeaconBlock (1000000 B) 227.61 us/op 163.18 us/op 1.39
pass gossip attestations to forkchoice per slot 3.7365 ms/op 3.7422 ms/op 1.00
forkChoice updateHead vc 100000 bc 64 eq 0 699.83 us/op 705.28 us/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 0 4.6889 ms/op 4.2239 ms/op 1.11
forkChoice updateHead vc 1000000 bc 64 eq 0 7.7565 ms/op 7.1197 ms/op 1.09
forkChoice updateHead vc 600000 bc 320 eq 0 4.2754 ms/op 4.1234 ms/op 1.04
forkChoice updateHead vc 600000 bc 1200 eq 0 4.3658 ms/op 4.2431 ms/op 1.03
forkChoice updateHead vc 600000 bc 7200 eq 0 5.1728 ms/op 5.0793 ms/op 1.02
forkChoice updateHead vc 600000 bc 64 eq 1000 11.418 ms/op 11.204 ms/op 1.02
forkChoice updateHead vc 600000 bc 64 eq 10000 12.396 ms/op 12.155 ms/op 1.02
forkChoice updateHead vc 600000 bc 64 eq 300000 16.393 ms/op 16.493 ms/op 0.99
computeDeltas 500000 validators 300 proto nodes 6.4144 ms/op 6.2723 ms/op 1.02
computeDeltas 500000 validators 1200 proto nodes 6.4468 ms/op 6.1783 ms/op 1.04
computeDeltas 500000 validators 7200 proto nodes 6.2964 ms/op 6.1358 ms/op 1.03
computeDeltas 750000 validators 300 proto nodes 9.3784 ms/op 9.2484 ms/op 1.01
computeDeltas 750000 validators 1200 proto nodes 9.3881 ms/op 9.3323 ms/op 1.01
computeDeltas 750000 validators 7200 proto nodes 9.1998 ms/op 9.2074 ms/op 1.00
computeDeltas 1400000 validators 300 proto nodes 17.441 ms/op 17.580 ms/op 0.99
computeDeltas 1400000 validators 1200 proto nodes 17.435 ms/op 17.514 ms/op 1.00
computeDeltas 1400000 validators 7200 proto nodes 17.394 ms/op 17.798 ms/op 0.98
computeDeltas 2100000 validators 300 proto nodes 26.070 ms/op 26.711 ms/op 0.98
computeDeltas 2100000 validators 1200 proto nodes 26.350 ms/op 26.377 ms/op 1.00
computeDeltas 2100000 validators 7200 proto nodes 26.060 ms/op 26.700 ms/op 0.98
computeProposerBoostScoreFromBalances 500000 validators 3.1485 ms/op 3.2168 ms/op 0.98
computeProposerBoostScoreFromBalances 750000 validators 3.1645 ms/op 3.2367 ms/op 0.98
computeProposerBoostScoreFromBalances 1400000 validators 3.0896 ms/op 3.2503 ms/op 0.95
computeProposerBoostScoreFromBalances 2100000 validators 3.0782 ms/op 3.2584 ms/op 0.94
altair processAttestation - 250000 vs - 7PWei normalcase 2.2390 ms/op 2.4130 ms/op 0.93
altair processAttestation - 250000 vs - 7PWei worstcase 2.9588 ms/op 2.9819 ms/op 0.99
altair processAttestation - setStatus - 1/6 committees join 140.64 us/op 166.99 us/op 0.84
altair processAttestation - setStatus - 1/3 committees join 275.47 us/op 322.14 us/op 0.86
altair processAttestation - setStatus - 1/2 committees join 377.14 us/op 422.56 us/op 0.89
altair processAttestation - setStatus - 2/3 committees join 471.46 us/op 536.34 us/op 0.88
altair processAttestation - setStatus - 4/5 committees join 672.44 us/op 764.98 us/op 0.88
altair processAttestation - setStatus - 100% committees join 779.38 us/op 878.40 us/op 0.89
altair processBlock - 250000 vs - 7PWei normalcase 7.2512 ms/op 6.8554 ms/op 1.06
altair processBlock - 250000 vs - 7PWei normalcase hashState 30.401 ms/op 30.595 ms/op 0.99
altair processBlock - 250000 vs - 7PWei worstcase 38.295 ms/op 36.397 ms/op 1.05
altair processBlock - 250000 vs - 7PWei worstcase hashState 88.850 ms/op 89.248 ms/op 1.00
phase0 processBlock - 250000 vs - 7PWei normalcase 2.1914 ms/op 2.9083 ms/op 0.75
phase0 processBlock - 250000 vs - 7PWei worstcase 29.393 ms/op 29.147 ms/op 1.01
altair processEth1Data - 250000 vs - 7PWei normalcase 458.85 us/op 480.22 us/op 0.96
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 7.6780 us/op 14.000 us/op 0.55
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 58.138 us/op 73.963 us/op 0.79
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 12.586 us/op 21.434 us/op 0.59
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 10.257 us/op 17.909 us/op 0.57
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 111.58 us/op 257.19 us/op 0.43
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.2857 ms/op 2.1312 ms/op 0.60
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.4868 ms/op 1.8505 ms/op 0.80
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.5150 ms/op 2.7697 ms/op 0.55
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.6051 ms/op 3.7259 ms/op 0.97
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.2973 ms/op 2.3403 ms/op 0.98
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 5.0785 ms/op 5.5069 ms/op 0.92
Tree 40 250000 create 307.73 ms/op 318.08 ms/op 0.97
Tree 40 250000 get(125000) 186.41 ns/op 201.16 ns/op 0.93
Tree 40 250000 set(125000) 886.62 ns/op 963.88 ns/op 0.92
Tree 40 250000 toArray() 16.830 ms/op 18.964 ms/op 0.89
Tree 40 250000 iterate all - toArray() + loop 17.031 ms/op 18.997 ms/op 0.90
Tree 40 250000 iterate all - get(i) 63.961 ms/op 67.199 ms/op 0.95
MutableVector 250000 create 12.267 ms/op 15.813 ms/op 0.78
MutableVector 250000 get(125000) 6.3340 ns/op 6.5680 ns/op 0.96
MutableVector 250000 set(125000) 245.85 ns/op 235.07 ns/op 1.05
MutableVector 250000 toArray() 2.9420 ms/op 3.0548 ms/op 0.96
MutableVector 250000 iterate all - toArray() + loop 3.1580 ms/op 3.1008 ms/op 1.02
MutableVector 250000 iterate all - get(i) 1.5126 ms/op 1.5435 ms/op 0.98
Array 250000 create 2.7336 ms/op 2.7517 ms/op 0.99
Array 250000 clone - spread 1.1963 ms/op 1.0064 ms/op 1.19
Array 250000 get(125000) 0.57600 ns/op 0.50600 ns/op 1.14
Array 250000 set(125000) 0.64800 ns/op 0.57000 ns/op 1.14
Array 250000 iterate all - loop 81.213 us/op 82.335 us/op 0.99
effectiveBalanceIncrements clone Uint8Array 300000 26.016 us/op 22.611 us/op 1.15
effectiveBalanceIncrements clone MutableVector 300000 348.00 ns/op 273.00 ns/op 1.27
effectiveBalanceIncrements rw all Uint8Array 300000 176.06 us/op 176.47 us/op 1.00
effectiveBalanceIncrements rw all MutableVector 300000 80.014 ms/op 74.799 ms/op 1.07
phase0 afterProcessEpoch - 250000 vs - 7PWei 112.74 ms/op 113.76 ms/op 0.99
phase0 beforeProcessEpoch - 250000 vs - 7PWei 30.667 ms/op 41.924 ms/op 0.73
altair processEpoch - mainnet_e81889 445.79 ms/op 482.25 ms/op 0.92
mainnet_e81889 - altair beforeProcessEpoch 58.262 ms/op 62.609 ms/op 0.93
mainnet_e81889 - altair processJustificationAndFinalization 14.494 us/op 19.940 us/op 0.73
mainnet_e81889 - altair processInactivityUpdates 6.5797 ms/op 7.3170 ms/op 0.90
mainnet_e81889 - altair processRewardsAndPenalties 62.622 ms/op 75.133 ms/op 0.83
mainnet_e81889 - altair processRegistryUpdates 2.5890 us/op 3.8760 us/op 0.67
mainnet_e81889 - altair processSlashings 437.00 ns/op 948.00 ns/op 0.46
mainnet_e81889 - altair processEth1DataReset 550.00 ns/op 1.0600 us/op 0.52
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2782 ms/op 2.4532 ms/op 0.52
mainnet_e81889 - altair processSlashingsReset 3.2550 us/op 4.5150 us/op 0.72
mainnet_e81889 - altair processRandaoMixesReset 6.9950 us/op 7.1780 us/op 0.97
mainnet_e81889 - altair processHistoricalRootsUpdate 798.00 ns/op 985.00 ns/op 0.81
mainnet_e81889 - altair processParticipationFlagUpdates 2.0750 us/op 2.5640 us/op 0.81
mainnet_e81889 - altair processSyncCommitteeUpdates 604.00 ns/op 1.0900 us/op 0.55
mainnet_e81889 - altair afterProcessEpoch 116.67 ms/op 121.36 ms/op 0.96
capella processEpoch - mainnet_e217614 1.4275 s/op 1.4618 s/op 0.98
mainnet_e217614 - capella beforeProcessEpoch 224.30 ms/op 225.47 ms/op 0.99
mainnet_e217614 - capella processJustificationAndFinalization 11.911 us/op 22.055 us/op 0.54
mainnet_e217614 - capella processInactivityUpdates 18.309 ms/op 17.976 ms/op 1.02
mainnet_e217614 - capella processRewardsAndPenalties 259.23 ms/op 287.40 ms/op 0.90
mainnet_e217614 - capella processRegistryUpdates 18.708 us/op 26.275 us/op 0.71
mainnet_e217614 - capella processSlashings 437.00 ns/op 1.3240 us/op 0.33
mainnet_e217614 - capella processEth1DataReset 558.00 ns/op 702.00 ns/op 0.79
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.2222 ms/op 4.4269 ms/op 0.95
mainnet_e217614 - capella processSlashingsReset 2.9950 us/op 3.7450 us/op 0.80
mainnet_e217614 - capella processRandaoMixesReset 4.9320 us/op 7.8510 us/op 0.63
mainnet_e217614 - capella processHistoricalRootsUpdate 648.00 ns/op 3.1210 us/op 0.21
mainnet_e217614 - capella processParticipationFlagUpdates 2.0900 us/op 2.5750 us/op 0.81
mainnet_e217614 - capella afterProcessEpoch 292.49 ms/op 311.12 ms/op 0.94
phase0 processEpoch - mainnet_e58758 426.35 ms/op 434.20 ms/op 0.98
mainnet_e58758 - phase0 beforeProcessEpoch 111.15 ms/op 128.34 ms/op 0.87
mainnet_e58758 - phase0 processJustificationAndFinalization 14.923 us/op 16.339 us/op 0.91
mainnet_e58758 - phase0 processRewardsAndPenalties 50.539 ms/op 60.379 ms/op 0.84
mainnet_e58758 - phase0 processRegistryUpdates 9.7300 us/op 11.184 us/op 0.87
mainnet_e58758 - phase0 processSlashings 520.00 ns/op 597.00 ns/op 0.87
mainnet_e58758 - phase0 processEth1DataReset 456.00 ns/op 498.00 ns/op 0.92
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1937 ms/op 1.2382 ms/op 0.96
mainnet_e58758 - phase0 processSlashingsReset 2.3380 us/op 2.5380 us/op 0.92
mainnet_e58758 - phase0 processRandaoMixesReset 3.9330 us/op 7.5280 us/op 0.52
mainnet_e58758 - phase0 processHistoricalRootsUpdate 451.00 ns/op 650.00 ns/op 0.69
mainnet_e58758 - phase0 processParticipationRecordUpdates 2.8510 us/op 4.2720 us/op 0.67
mainnet_e58758 - phase0 afterProcessEpoch 96.000 ms/op 100.63 ms/op 0.95
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2573 ms/op 2.4327 ms/op 0.52
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.3773 ms/op 1.9406 ms/op 0.71
altair processInactivityUpdates - 250000 normalcase 16.776 ms/op 25.533 ms/op 0.66
altair processInactivityUpdates - 250000 worstcase 16.651 ms/op 24.566 ms/op 0.68
phase0 processRegistryUpdates - 250000 normalcase 7.4480 us/op 10.598 us/op 0.70
phase0 processRegistryUpdates - 250000 badcase_full_deposits 324.75 us/op 386.44 us/op 0.84
phase0 processRegistryUpdates - 250000 worstcase 0.5 124.59 ms/op 138.66 ms/op 0.90
altair processRewardsAndPenalties - 250000 normalcase 44.897 ms/op 65.941 ms/op 0.68
altair processRewardsAndPenalties - 250000 worstcase 54.255 ms/op 66.645 ms/op 0.81
phase0 getAttestationDeltas - 250000 normalcase 7.5760 ms/op 8.1418 ms/op 0.93
phase0 getAttestationDeltas - 250000 worstcase 7.8388 ms/op 8.1183 ms/op 0.97
phase0 processSlashings - 250000 worstcase 2.3555 ms/op 2.4881 ms/op 0.95
altair processSyncCommitteeUpdates - 250000 149.25 ms/op 154.36 ms/op 0.97
BeaconState.hashTreeRoot - No change 344.00 ns/op 326.00 ns/op 1.06
BeaconState.hashTreeRoot - 1 full validator 133.43 us/op 123.70 us/op 1.08
BeaconState.hashTreeRoot - 32 full validator 1.3469 ms/op 1.8759 ms/op 0.72
BeaconState.hashTreeRoot - 512 full validator 14.413 ms/op 15.723 ms/op 0.92
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 150.17 us/op 165.14 us/op 0.91
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.1887 ms/op 1.9026 ms/op 1.15
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 28.392 ms/op 28.022 ms/op 1.01
BeaconState.hashTreeRoot - 1 balances 130.60 us/op 127.05 us/op 1.03
BeaconState.hashTreeRoot - 32 balances 1.2294 ms/op 1.1809 ms/op 1.04
BeaconState.hashTreeRoot - 512 balances 12.548 ms/op 14.263 ms/op 0.88
BeaconState.hashTreeRoot - 250000 balances 204.21 ms/op 197.42 ms/op 1.03
aggregationBits - 2048 els - zipIndexesInBitList 15.385 us/op 16.152 us/op 0.95
regular array get 100000 times 31.393 us/op 44.421 us/op 0.71
wrappedArray get 100000 times 33.191 us/op 41.702 us/op 0.80
arrayWithProxy get 100000 times 13.877 ms/op 14.591 ms/op 0.95
ssz.Root.equals 218.00 ns/op 234.00 ns/op 0.93
byteArrayEquals 215.00 ns/op 225.00 ns/op 0.96
shuffle list - 16384 els 6.8697 ms/op 6.9841 ms/op 0.98
shuffle list - 250000 els 100.22 ms/op 102.68 ms/op 0.98
processSlot - 1 slots 16.884 us/op 16.212 us/op 1.04
processSlot - 32 slots 3.5059 ms/op 3.0222 ms/op 1.16
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 53.112 ms/op 53.710 ms/op 0.99
getCommitteeAssignments - req 1 vs - 250000 vc 2.4042 ms/op 2.5153 ms/op 0.96
getCommitteeAssignments - req 100 vs - 250000 vc 3.5570 ms/op 3.7196 ms/op 0.96
getCommitteeAssignments - req 1000 vs - 250000 vc 3.8674 ms/op 4.0293 ms/op 0.96
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.9200 ns/op 4.2000 ns/op 1.17
state getBlockRootAtSlot - 250000 vs - 7PWei 843.59 ns/op 518.94 ns/op 1.63
computeProposers - vc 250000 8.9213 ms/op 8.6791 ms/op 1.03
computeEpochShuffling - vc 250000 99.938 ms/op 104.03 ms/op 0.96
getNextSyncCommittee - vc 250000 150.79 ms/op 144.74 ms/op 1.04
computeSigningRoot for AttestationData 23.818 us/op 20.343 us/op 1.17
hash AttestationData serialized data then Buffer.toString(base64) 2.2257 us/op 2.2902 us/op 0.97
toHexString serialized data 1.0492 us/op 1.0393 us/op 1.01
Buffer.toString(base64) 222.19 ns/op 199.62 ns/op 1.11

by benchmarkbot/action

wemeetagain
wemeetagain previously approved these changes Sep 1, 2023
@dapplion
Copy link
Contributor

dapplion commented Sep 1, 2023

@tuyennhv do you have any evidence that this usage is a problem? This allocates relatively few items per second

@twoeths
Copy link
Contributor Author

twoeths commented Sep 3, 2023

@tuyennhv do you have any evidence that this usage is a problem? This allocates relatively few items per second

@dapplion yes the usage is not much, I deployed this branch to a group and it does not show a clear difference.

@twoeths twoeths force-pushed the tuyen/avoid_process_hrtime_bigint branch from 12b6772 to f28fb1a Compare September 11, 2023 04:17
@twoeths twoeths merged commit 26ce156 into unstable Sep 12, 2023
11 checks passed
@twoeths twoeths deleted the tuyen/avoid_process_hrtime_bigint branch September 12, 2023 08:23
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.12.0 🎉

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.

3 participants