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: optimize getSlotFromOffset #6941

Merged
merged 2 commits into from
Jul 11, 2024
Merged

Conversation

wemeetagain
Copy link
Member

@wemeetagain wemeetagain commented Jul 9, 2024

Description

This is just a small optimization, likely of little consequence.

  • instead of creating/using a DataView#getUint32 to get the slot, just use the underlying Uint8Array bytes
  dataview
    ✔ getUint32 - dataview                                                 2544529 ops/s    393.0000 ns/op        -    1909649 runs   1.41 s
    ✔ getUint32 - manual                                                   4854369 ops/s    206.0000 ns/op        -     930789 runs  0.505 s

@wemeetagain wemeetagain requested a review from a team as a code owner July 9, 2024 21:11
Copy link

codecov bot commented Jul 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.51%. Comparing base (9b728ed) to head (2d4ff5f).
Report is 1 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #6941      +/-   ##
============================================
- Coverage     62.51%   62.51%   -0.01%     
============================================
  Files           575      575              
  Lines         61015    61015              
  Branches       2129     2120       -9     
============================================
- Hits          38143    38141       -2     
- Misses        22833    22835       +2     
  Partials         39       39              

Copy link
Contributor

github-actions bot commented Jul 9, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 200e0a8 Previous: 9b728ed Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 964.22 us/op 729.94 us/op 1.32
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 49.798 us/op 67.023 us/op 0.74
BLS verify - blst-native 1.2022 ms/op 1.5139 ms/op 0.79
BLS verifyMultipleSignatures 3 - blst-native 2.5568 ms/op 3.0901 ms/op 0.83
BLS verifyMultipleSignatures 8 - blst-native 5.6374 ms/op 6.8292 ms/op 0.83
BLS verifyMultipleSignatures 32 - blst-native 20.713 ms/op 25.547 ms/op 0.81
BLS verifyMultipleSignatures 64 - blst-native 40.792 ms/op 51.391 ms/op 0.79
BLS verifyMultipleSignatures 128 - blst-native 81.048 ms/op 99.681 ms/op 0.81
BLS deserializing 10000 signatures 838.99 ms/op 1.1904 s/op 0.70
BLS deserializing 100000 signatures 8.6687 s/op 10.083 s/op 0.86
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.2957 ms/op 1.4347 ms/op 0.90
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.4016 ms/op 1.5382 ms/op 0.91
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.1963 ms/op 2.3959 ms/op 0.92
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.2182 ms/op 3.5889 ms/op 0.90
BLS verifyMultipleSignatures - same message - 128 - blst-native 6.3333 ms/op 6.0643 ms/op 1.04
BLS aggregatePubkeys 32 - blst-native 24.955 us/op 27.935 us/op 0.89
BLS aggregatePubkeys 128 - blst-native 97.782 us/op 110.76 us/op 0.88
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 84.003 ms/op 69.604 ms/op 1.21
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 77.038 ms/op 62.863 ms/op 1.23
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 38.917 ms/op 37.559 ms/op 1.04
getSlashingsAndExits - default max 103.31 us/op 101.07 us/op 1.02
getSlashingsAndExits - 2k 284.95 us/op 314.34 us/op 0.91
proposeBlockBody type=full, size=empty 5.6678 ms/op 6.3006 ms/op 0.90
isKnown best case - 1 super set check 290.00 ns/op 341.00 ns/op 0.85
isKnown normal case - 2 super set checks 279.00 ns/op 354.00 ns/op 0.79
isKnown worse case - 16 super set checks 288.00 ns/op 338.00 ns/op 0.85
InMemoryCheckpointStateCache - add get delete 4.3820 us/op 4.6850 us/op 0.94
validate api signedAggregateAndProof - struct 2.6181 ms/op 2.7182 ms/op 0.96
validate gossip signedAggregateAndProof - struct 2.6249 ms/op 2.6971 ms/op 0.97
validate gossip attestation - vc 640000 1.2708 ms/op 1.3256 ms/op 0.96
batch validate gossip attestation - vc 640000 - chunk 32 152.05 us/op 162.48 us/op 0.94
batch validate gossip attestation - vc 640000 - chunk 64 133.40 us/op 139.12 us/op 0.96
batch validate gossip attestation - vc 640000 - chunk 128 121.89 us/op 135.55 us/op 0.90
batch validate gossip attestation - vc 640000 - chunk 256 115.11 us/op 146.66 us/op 0.78
pickEth1Vote - no votes 1.0108 ms/op 1.3410 ms/op 0.75
pickEth1Vote - max votes 10.631 ms/op 11.703 ms/op 0.91
pickEth1Vote - Eth1Data hashTreeRoot value x2048 15.354 ms/op 17.681 ms/op 0.87
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 26.354 ms/op 31.789 ms/op 0.83
pickEth1Vote - Eth1Data fastSerialize value x2048 492.84 us/op 881.14 us/op 0.56
pickEth1Vote - Eth1Data fastSerialize tree x2048 6.5635 ms/op 6.2467 ms/op 1.05
bytes32 toHexString 420.00 ns/op 814.00 ns/op 0.52
bytes32 Buffer.toString(hex) 254.00 ns/op 400.00 ns/op 0.64
bytes32 Buffer.toString(hex) from Uint8Array 373.00 ns/op 598.00 ns/op 0.62
bytes32 Buffer.toString(hex) + 0x 253.00 ns/op 526.00 ns/op 0.48
Object access 1 prop 0.12700 ns/op 0.23200 ns/op 0.55
Map access 1 prop 0.12500 ns/op 0.22900 ns/op 0.55
Object get x1000 5.6650 ns/op 8.8220 ns/op 0.64
Map get x1000 6.7910 ns/op 9.4730 ns/op 0.72
Object set x1000 31.266 ns/op 69.399 ns/op 0.45
Map set x1000 21.368 ns/op 47.099 ns/op 0.45
Return object 10000 times 0.28730 ns/op 0.48360 ns/op 0.59
Throw Error 10000 times 3.2670 us/op 5.1126 us/op 0.64
fastMsgIdFn sha256 / 200 bytes 2.1450 us/op 3.2580 us/op 0.66
fastMsgIdFn h32 xxhash / 200 bytes 234.00 ns/op 388.00 ns/op 0.60
fastMsgIdFn h64 xxhash / 200 bytes 259.00 ns/op 361.00 ns/op 0.72
fastMsgIdFn sha256 / 1000 bytes 7.0950 us/op 9.6430 us/op 0.74
fastMsgIdFn h32 xxhash / 1000 bytes 359.00 ns/op 591.00 ns/op 0.61
fastMsgIdFn h64 xxhash / 1000 bytes 335.00 ns/op 524.00 ns/op 0.64
fastMsgIdFn sha256 / 10000 bytes 62.759 us/op 89.566 us/op 0.70
fastMsgIdFn h32 xxhash / 10000 bytes 1.8240 us/op 3.0660 us/op 0.59
fastMsgIdFn h64 xxhash / 10000 bytes 1.2060 us/op 2.3880 us/op 0.51
send data - 1000 256B messages 12.154 ms/op 20.026 ms/op 0.61
send data - 1000 512B messages 16.096 ms/op 24.535 ms/op 0.66
send data - 1000 1024B messages 27.385 ms/op 34.148 ms/op 0.80
send data - 1000 1200B messages 25.459 ms/op 33.860 ms/op 0.75
send data - 1000 2048B messages 31.603 ms/op 42.269 ms/op 0.75
send data - 1000 4096B messages 30.910 ms/op 36.199 ms/op 0.85
send data - 1000 16384B messages 73.332 ms/op 81.247 ms/op 0.90
send data - 1000 65536B messages 198.07 ms/op 232.72 ms/op 0.85
enrSubnets - fastDeserialize 64 bits 1.0630 us/op 1.3240 us/op 0.80
enrSubnets - ssz BitVector 64 bits 329.00 ns/op 479.00 ns/op 0.69
enrSubnets - fastDeserialize 4 bits 145.00 ns/op 208.00 ns/op 0.70
enrSubnets - ssz BitVector 4 bits 338.00 ns/op 456.00 ns/op 0.74
prioritizePeers score -10:0 att 32-0.1 sync 2-0 129.49 us/op 209.85 us/op 0.62
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 153.33 us/op 239.82 us/op 0.64
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 220.08 us/op 463.05 us/op 0.48
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 383.65 us/op 634.67 us/op 0.60
prioritizePeers score 0:0 att 64-1 sync 4-1 472.64 us/op 1.2186 ms/op 0.39
array of 16000 items push then shift 1.5446 us/op 2.1878 us/op 0.71
LinkedList of 16000 items push then shift 6.7270 ns/op 11.169 ns/op 0.60
array of 16000 items push then pop 98.053 ns/op 169.04 ns/op 0.58
LinkedList of 16000 items push then pop 6.8550 ns/op 10.183 ns/op 0.67
array of 24000 items push then shift 2.3558 us/op 3.3070 us/op 0.71
LinkedList of 24000 items push then shift 6.9090 ns/op 9.7680 ns/op 0.71
array of 24000 items push then pop 131.40 ns/op 213.56 ns/op 0.62
LinkedList of 24000 items push then pop 6.7850 ns/op 10.160 ns/op 0.67
intersect bitArray bitLen 8 6.2760 ns/op 8.8910 ns/op 0.71
intersect array and set length 8 42.810 ns/op 68.306 ns/op 0.63
intersect bitArray bitLen 128 29.674 ns/op 42.062 ns/op 0.71
intersect array and set length 128 643.49 ns/op 1.0042 us/op 0.64
bitArray.getTrueBitIndexes() bitLen 128 1.3120 us/op 2.4970 us/op 0.53
bitArray.getTrueBitIndexes() bitLen 248 2.1310 us/op 4.9310 us/op 0.43
bitArray.getTrueBitIndexes() bitLen 512 4.1380 us/op 9.7270 us/op 0.43
Buffer.concat 32 items 896.00 ns/op 1.0940 us/op 0.82
Uint8Array.set 32 items 1.8210 us/op 2.1450 us/op 0.85
Buffer.copy 2.3640 us/op 2.7210 us/op 0.87
Uint8Array.set - with subarray 3.5020 us/op 2.9180 us/op 1.20
Uint8Array.set - without subarray 1.8180 us/op 1.9730 us/op 0.92
getUint32 - dataview 225.00 ns/op
getUint32 - manual 146.00 ns/op
Set add up to 64 items then delete first 2.0762 us/op 2.5050 us/op 0.83
OrderedSet add up to 64 items then delete first 3.1544 us/op 3.7735 us/op 0.84
Set add up to 64 items then delete last 2.3663 us/op 2.9259 us/op 0.81
OrderedSet add up to 64 items then delete last 3.5336 us/op 4.6646 us/op 0.76
Set add up to 64 items then delete middle 2.4344 us/op 3.0974 us/op 0.79
OrderedSet add up to 64 items then delete middle 4.9831 us/op 6.5648 us/op 0.76
Set add up to 128 items then delete first 4.8165 us/op 6.3380 us/op 0.76
OrderedSet add up to 128 items then delete first 7.5458 us/op 10.181 us/op 0.74
Set add up to 128 items then delete last 4.7301 us/op 6.7887 us/op 0.70
OrderedSet add up to 128 items then delete last 6.9867 us/op 10.296 us/op 0.68
Set add up to 128 items then delete middle 4.6925 us/op 6.3699 us/op 0.74
OrderedSet add up to 128 items then delete middle 13.502 us/op 17.484 us/op 0.77
Set add up to 256 items then delete first 9.9110 us/op 12.737 us/op 0.78
OrderedSet add up to 256 items then delete first 15.634 us/op 19.476 us/op 0.80
Set add up to 256 items then delete last 9.4065 us/op 12.302 us/op 0.76
OrderedSet add up to 256 items then delete last 14.620 us/op 18.608 us/op 0.79
Set add up to 256 items then delete middle 9.3131 us/op 13.577 us/op 0.69
OrderedSet add up to 256 items then delete middle 40.321 us/op 51.803 us/op 0.78
transfer serialized Status (84 B) 1.4860 us/op 1.5620 us/op 0.95
copy serialized Status (84 B) 1.2140 us/op 1.3330 us/op 0.91
transfer serialized SignedVoluntaryExit (112 B) 1.5660 us/op 1.7720 us/op 0.88
copy serialized SignedVoluntaryExit (112 B) 1.3140 us/op 1.4890 us/op 0.88
transfer serialized ProposerSlashing (416 B) 2.1990 us/op 2.5870 us/op 0.85
copy serialized ProposerSlashing (416 B) 2.1080 us/op 2.7170 us/op 0.78
transfer serialized Attestation (485 B) 2.4340 us/op 2.6430 us/op 0.92
copy serialized Attestation (485 B) 2.5560 us/op 2.9180 us/op 0.88
transfer serialized AttesterSlashing (33232 B) 2.6990 us/op 2.8360 us/op 0.95
copy serialized AttesterSlashing (33232 B) 6.3100 us/op 8.1930 us/op 0.77
transfer serialized Small SignedBeaconBlock (128000 B) 3.4210 us/op 2.3440 us/op 1.46
copy serialized Small SignedBeaconBlock (128000 B) 14.485 us/op 16.923 us/op 0.86
transfer serialized Avg SignedBeaconBlock (200000 B) 3.4360 us/op 2.6750 us/op 1.28
copy serialized Avg SignedBeaconBlock (200000 B) 20.398 us/op 25.251 us/op 0.81
transfer serialized BlobsSidecar (524380 B) 3.1030 us/op 3.1650 us/op 0.98
copy serialized BlobsSidecar (524380 B) 101.59 us/op 135.95 us/op 0.75
transfer serialized Big SignedBeaconBlock (1000000 B) 3.0220 us/op 3.2190 us/op 0.94
copy serialized Big SignedBeaconBlock (1000000 B) 213.42 us/op 168.23 us/op 1.27
pass gossip attestations to forkchoice per slot 3.0822 ms/op 3.2773 ms/op 0.94
forkChoice updateHead vc 100000 bc 64 eq 0 516.01 us/op 536.00 us/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 0 3.0191 ms/op 3.8473 ms/op 0.78
forkChoice updateHead vc 1000000 bc 64 eq 0 5.2317 ms/op 5.8690 ms/op 0.89
forkChoice updateHead vc 600000 bc 320 eq 0 2.9448 ms/op 3.3799 ms/op 0.87
forkChoice updateHead vc 600000 bc 1200 eq 0 2.9449 ms/op 4.6243 ms/op 0.64
forkChoice updateHead vc 600000 bc 7200 eq 0 3.8521 ms/op 4.1914 ms/op 0.92
forkChoice updateHead vc 600000 bc 64 eq 1000 10.604 ms/op 12.599 ms/op 0.84
forkChoice updateHead vc 600000 bc 64 eq 10000 10.392 ms/op 11.391 ms/op 0.91
forkChoice updateHead vc 600000 bc 64 eq 300000 14.299 ms/op 15.344 ms/op 0.93
computeDeltas 500000 validators 300 proto nodes 3.4163 ms/op 4.0967 ms/op 0.83
computeDeltas 500000 validators 1200 proto nodes 3.5133 ms/op 4.1173 ms/op 0.85
computeDeltas 500000 validators 7200 proto nodes 3.5016 ms/op 4.1092 ms/op 0.85
computeDeltas 750000 validators 300 proto nodes 5.1815 ms/op 5.8928 ms/op 0.88
computeDeltas 750000 validators 1200 proto nodes 5.1969 ms/op 5.7157 ms/op 0.91
computeDeltas 750000 validators 7200 proto nodes 5.2387 ms/op 5.8439 ms/op 0.90
computeDeltas 1400000 validators 300 proto nodes 9.9406 ms/op 10.954 ms/op 0.91
computeDeltas 1400000 validators 1200 proto nodes 10.119 ms/op 12.364 ms/op 0.82
computeDeltas 1400000 validators 7200 proto nodes 10.013 ms/op 12.631 ms/op 0.79
computeDeltas 2100000 validators 300 proto nodes 14.811 ms/op 17.184 ms/op 0.86
computeDeltas 2100000 validators 1200 proto nodes 15.011 ms/op 17.032 ms/op 0.88
computeDeltas 2100000 validators 7200 proto nodes 15.335 ms/op 16.858 ms/op 0.91
altair processAttestation - 250000 vs - 7PWei normalcase 2.0281 ms/op 1.9709 ms/op 1.03
altair processAttestation - 250000 vs - 7PWei worstcase 3.0622 ms/op 2.5575 ms/op 1.20
altair processAttestation - setStatus - 1/6 committees join 129.86 us/op 98.961 us/op 1.31
altair processAttestation - setStatus - 1/3 committees join 249.13 us/op 188.30 us/op 1.32
altair processAttestation - setStatus - 1/2 committees join 351.63 us/op 272.15 us/op 1.29
altair processAttestation - setStatus - 2/3 committees join 444.47 us/op 350.93 us/op 1.27
altair processAttestation - setStatus - 4/5 committees join 616.93 us/op 525.14 us/op 1.17
altair processAttestation - setStatus - 100% committees join 728.73 us/op 590.78 us/op 1.23
altair processBlock - 250000 vs - 7PWei normalcase 5.3069 ms/op 5.5304 ms/op 0.96
altair processBlock - 250000 vs - 7PWei normalcase hashState 26.882 ms/op 30.085 ms/op 0.89
altair processBlock - 250000 vs - 7PWei worstcase 48.829 ms/op 45.365 ms/op 1.08
altair processBlock - 250000 vs - 7PWei worstcase hashState 84.694 ms/op 103.19 ms/op 0.82
phase0 processBlock - 250000 vs - 7PWei normalcase 2.3575 ms/op 2.5568 ms/op 0.92
phase0 processBlock - 250000 vs - 7PWei worstcase 29.270 ms/op 31.671 ms/op 0.92
altair processEth1Data - 250000 vs - 7PWei normalcase 362.28 us/op 409.78 us/op 0.88
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 5.6660 us/op 8.1150 us/op 0.70
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 25.875 us/op 28.343 us/op 0.91
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 8.9740 us/op 10.413 us/op 0.86
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 5.8720 us/op 7.1550 us/op 0.82
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 113.92 us/op 102.60 us/op 1.11
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 895.19 us/op 970.17 us/op 0.92
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 911.21 us/op 1.1210 ms/op 0.81
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.0578 ms/op 1.2084 ms/op 0.88
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.7714 ms/op 2.9133 ms/op 0.95
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.5961 ms/op 1.9082 ms/op 0.84
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.8678 ms/op 4.5166 ms/op 0.86
Tree 40 250000 create 248.76 ms/op 295.87 ms/op 0.84
Tree 40 250000 get(125000) 153.78 ns/op 177.72 ns/op 0.87
Tree 40 250000 set(125000) 664.04 ns/op 818.28 ns/op 0.81
Tree 40 250000 toArray() 18.783 ms/op 22.007 ms/op 0.85
Tree 40 250000 iterate all - toArray() + loop 20.295 ms/op 22.522 ms/op 0.90
Tree 40 250000 iterate all - get(i) 57.266 ms/op 70.133 ms/op 0.82
MutableVector 250000 create 13.019 ms/op 16.054 ms/op 0.81
MutableVector 250000 get(125000) 6.4180 ns/op 8.1400 ns/op 0.79
MutableVector 250000 set(125000) 224.57 ns/op 226.44 ns/op 0.99
MutableVector 250000 toArray() 4.2961 ms/op 5.6868 ms/op 0.76
MutableVector 250000 iterate all - toArray() + loop 4.4412 ms/op 5.2225 ms/op 0.85
MutableVector 250000 iterate all - get(i) 1.8438 ms/op 2.1139 ms/op 0.87
Array 250000 create 3.6365 ms/op 4.5738 ms/op 0.80
Array 250000 clone - spread 1.6160 ms/op 1.6951 ms/op 0.95
Array 250000 get(125000) 0.43700 ns/op 0.48200 ns/op 0.91
Array 250000 set(125000) 0.46800 ns/op 0.48700 ns/op 0.96
Array 250000 iterate all - loop 106.98 us/op 118.64 us/op 0.90
effectiveBalanceIncrements clone Uint8Array 300000 36.912 us/op 46.690 us/op 0.79
effectiveBalanceIncrements clone MutableVector 300000 131.00 ns/op 131.00 ns/op 1.00
effectiveBalanceIncrements rw all Uint8Array 300000 205.51 us/op 226.49 us/op 0.91
effectiveBalanceIncrements rw all MutableVector 300000 74.687 ms/op 82.519 ms/op 0.91
phase0 afterProcessEpoch - 250000 vs - 7PWei 92.610 ms/op 117.30 ms/op 0.79
phase0 beforeProcessEpoch - 250000 vs - 7PWei 37.054 ms/op 53.944 ms/op 0.69
altair processEpoch - mainnet_e81889 401.35 ms/op 480.70 ms/op 0.83
mainnet_e81889 - altair beforeProcessEpoch 72.289 ms/op 85.936 ms/op 0.84
mainnet_e81889 - altair processJustificationAndFinalization 12.214 us/op 24.131 us/op 0.51
mainnet_e81889 - altair processInactivityUpdates 6.7139 ms/op 7.9692 ms/op 0.84
mainnet_e81889 - altair processRewardsAndPenalties 44.234 ms/op 55.583 ms/op 0.80
mainnet_e81889 - altair processRegistryUpdates 1.7100 us/op 4.3520 us/op 0.39
mainnet_e81889 - altair processSlashings 424.00 ns/op 603.00 ns/op 0.70
mainnet_e81889 - altair processEth1DataReset 361.00 ns/op 551.00 ns/op 0.66
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2818 ms/op 1.4890 ms/op 0.86
mainnet_e81889 - altair processSlashingsReset 4.1070 us/op 6.9880 us/op 0.59
mainnet_e81889 - altair processRandaoMixesReset 4.1700 us/op 6.1870 us/op 0.67
mainnet_e81889 - altair processHistoricalRootsUpdate 466.00 ns/op 698.00 ns/op 0.67
mainnet_e81889 - altair processParticipationFlagUpdates 2.8000 us/op 2.8590 us/op 0.98
mainnet_e81889 - altair processSyncCommitteeUpdates 985.00 ns/op 578.00 ns/op 1.70
mainnet_e81889 - altair afterProcessEpoch 96.491 ms/op 112.81 ms/op 0.86
capella processEpoch - mainnet_e217614 1.2976 s/op 1.8626 s/op 0.70
mainnet_e217614 - capella beforeProcessEpoch 256.33 ms/op 357.62 ms/op 0.72
mainnet_e217614 - capella processJustificationAndFinalization 20.380 us/op 24.892 us/op 0.82
mainnet_e217614 - capella processInactivityUpdates 17.795 ms/op 23.235 ms/op 0.77
mainnet_e217614 - capella processRewardsAndPenalties 261.41 ms/op 304.40 ms/op 0.86
mainnet_e217614 - capella processRegistryUpdates 17.891 us/op 25.647 us/op 0.70
mainnet_e217614 - capella processSlashings 605.00 ns/op 656.00 ns/op 0.92
mainnet_e217614 - capella processEth1DataReset 496.00 ns/op 893.00 ns/op 0.56
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.9386 ms/op 6.0504 ms/op 0.82
mainnet_e217614 - capella processSlashingsReset 4.1360 us/op 8.1210 us/op 0.51
mainnet_e217614 - capella processRandaoMixesReset 5.4800 us/op 8.2110 us/op 0.67
mainnet_e217614 - capella processHistoricalRootsUpdate 401.00 ns/op 1.3850 us/op 0.29
mainnet_e217614 - capella processParticipationFlagUpdates 4.8350 us/op 5.6510 us/op 0.86
mainnet_e217614 - capella afterProcessEpoch 238.59 ms/op 372.90 ms/op 0.64
phase0 processEpoch - mainnet_e58758 403.17 ms/op 492.24 ms/op 0.82
mainnet_e58758 - phase0 beforeProcessEpoch 110.41 ms/op 192.41 ms/op 0.57
mainnet_e58758 - phase0 processJustificationAndFinalization 23.057 us/op 32.902 us/op 0.70
mainnet_e58758 - phase0 processRewardsAndPenalties 33.239 ms/op 37.734 ms/op 0.88
mainnet_e58758 - phase0 processRegistryUpdates 11.787 us/op 10.879 us/op 1.08
mainnet_e58758 - phase0 processSlashings 623.00 ns/op 557.00 ns/op 1.12
mainnet_e58758 - phase0 processEth1DataReset 464.00 ns/op 711.00 ns/op 0.65
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.4230 ms/op 1.2349 ms/op 1.96
mainnet_e58758 - phase0 processSlashingsReset 4.6980 us/op 6.2840 us/op 0.75
mainnet_e58758 - phase0 processRandaoMixesReset 3.5680 us/op 9.1020 us/op 0.39
mainnet_e58758 - phase0 processHistoricalRootsUpdate 662.00 ns/op 717.00 ns/op 0.92
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.8440 us/op 3.7860 us/op 1.02
mainnet_e58758 - phase0 afterProcessEpoch 75.579 ms/op 93.642 ms/op 0.81
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.0898 ms/op 1.7095 ms/op 0.64
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.5587 ms/op 3.4464 ms/op 0.45
altair processInactivityUpdates - 250000 normalcase 21.666 ms/op 28.702 ms/op 0.75
altair processInactivityUpdates - 250000 worstcase 20.384 ms/op 29.337 ms/op 0.69
phase0 processRegistryUpdates - 250000 normalcase 9.6520 us/op 14.298 us/op 0.68
phase0 processRegistryUpdates - 250000 badcase_full_deposits 450.73 us/op 459.52 us/op 0.98
phase0 processRegistryUpdates - 250000 worstcase 0.5 120.22 ms/op 203.47 ms/op 0.59
altair processRewardsAndPenalties - 250000 normalcase 41.405 ms/op 74.738 ms/op 0.55
altair processRewardsAndPenalties - 250000 worstcase 42.390 ms/op 73.835 ms/op 0.57
phase0 getAttestationDeltas - 250000 normalcase 7.3536 ms/op 16.634 ms/op 0.44
phase0 getAttestationDeltas - 250000 worstcase 8.2915 ms/op 15.464 ms/op 0.54
phase0 processSlashings - 250000 worstcase 115.19 us/op 120.31 us/op 0.96
altair processSyncCommitteeUpdates - 250000 125.50 ms/op 193.80 ms/op 0.65
BeaconState.hashTreeRoot - No change 298.00 ns/op 613.00 ns/op 0.49
BeaconState.hashTreeRoot - 1 full validator 87.278 us/op 174.84 us/op 0.50
BeaconState.hashTreeRoot - 32 full validator 887.36 us/op 1.6596 ms/op 0.53
BeaconState.hashTreeRoot - 512 full validator 10.088 ms/op 18.178 ms/op 0.55
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 112.76 us/op 229.66 us/op 0.49
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.7781 ms/op 3.3560 ms/op 0.53
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 23.604 ms/op 38.607 ms/op 0.61
BeaconState.hashTreeRoot - 1 balances 102.32 us/op 164.33 us/op 0.62
BeaconState.hashTreeRoot - 32 balances 876.82 us/op 1.4719 ms/op 0.60
BeaconState.hashTreeRoot - 512 balances 8.1498 ms/op 17.105 ms/op 0.48
BeaconState.hashTreeRoot - 250000 balances 174.14 ms/op 271.55 ms/op 0.64
aggregationBits - 2048 els - zipIndexesInBitList 24.906 us/op 46.319 us/op 0.54
byteArrayEquals 32 53.912 ns/op 70.638 ns/op 0.76
Buffer.compare 32 17.653 ns/op 23.729 ns/op 0.74
byteArrayEquals 1024 1.5868 us/op 2.0493 us/op 0.77
Buffer.compare 1024 26.556 ns/op 34.729 ns/op 0.76
byteArrayEquals 16384 25.150 us/op 33.311 us/op 0.76
Buffer.compare 16384 201.52 ns/op 248.73 ns/op 0.81
byteArrayEquals 123687377 190.98 ms/op 264.84 ms/op 0.72
Buffer.compare 123687377 6.7139 ms/op 13.327 ms/op 0.50
byteArrayEquals 32 - diff last byte 52.393 ns/op 72.660 ns/op 0.72
Buffer.compare 32 - diff last byte 17.719 ns/op 24.650 ns/op 0.72
byteArrayEquals 1024 - diff last byte 1.5798 us/op 1.9557 us/op 0.81
Buffer.compare 1024 - diff last byte 26.842 ns/op 30.383 ns/op 0.88
byteArrayEquals 16384 - diff last byte 25.213 us/op 29.052 us/op 0.87
Buffer.compare 16384 - diff last byte 189.05 ns/op 263.15 ns/op 0.72
byteArrayEquals 123687377 - diff last byte 193.72 ms/op 252.87 ms/op 0.77
Buffer.compare 123687377 - diff last byte 7.1875 ms/op 9.7394 ms/op 0.74
byteArrayEquals 32 - random bytes 5.3190 ns/op 6.1240 ns/op 0.87
Buffer.compare 32 - random bytes 17.690 ns/op 22.996 ns/op 0.77
byteArrayEquals 1024 - random bytes 5.2670 ns/op 6.2540 ns/op 0.84
Buffer.compare 1024 - random bytes 17.717 ns/op 20.874 ns/op 0.85
byteArrayEquals 16384 - random bytes 5.6150 ns/op 5.8500 ns/op 0.96
Buffer.compare 16384 - random bytes 17.854 ns/op 19.645 ns/op 0.91
byteArrayEquals 123687377 - random bytes 6.6100 ns/op 7.3500 ns/op 0.90
Buffer.compare 123687377 - random bytes 19.000 ns/op 21.360 ns/op 0.89
regular array get 100000 times 43.998 us/op 43.163 us/op 1.02
wrappedArray get 100000 times 36.171 us/op 44.135 us/op 0.82
arrayWithProxy get 100000 times 13.548 ms/op 15.093 ms/op 0.90
ssz.Root.equals 45.961 ns/op 52.061 ns/op 0.88
byteArrayEquals 45.570 ns/op 52.203 ns/op 0.87
Buffer.compare 10.618 ns/op 12.013 ns/op 0.88
shuffle list - 16384 els 6.5813 ms/op 7.2358 ms/op 0.91
shuffle list - 250000 els 96.202 ms/op 106.80 ms/op 0.90
processSlot - 1 slots 14.588 us/op 17.573 us/op 0.83
processSlot - 32 slots 2.4016 ms/op 3.7465 ms/op 0.64
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 38.489 ms/op 40.325 ms/op 0.95
getCommitteeAssignments - req 1 vs - 250000 vc 2.2207 ms/op 2.2853 ms/op 0.97
getCommitteeAssignments - req 100 vs - 250000 vc 4.3722 ms/op 4.5295 ms/op 0.97
getCommitteeAssignments - req 1000 vs - 250000 vc 4.6286 ms/op 4.9447 ms/op 0.94
findModifiedValidators - 10000 modified validators 252.38 ms/op 304.39 ms/op 0.83
findModifiedValidators - 1000 modified validators 177.80 ms/op 292.35 ms/op 0.61
findModifiedValidators - 100 modified validators 193.80 ms/op 276.43 ms/op 0.70
findModifiedValidators - 10 modified validators 184.69 ms/op 238.73 ms/op 0.77
findModifiedValidators - 1 modified validators 176.38 ms/op 245.99 ms/op 0.72
findModifiedValidators - no difference 164.30 ms/op 233.67 ms/op 0.70
compare ViewDUs 3.2079 s/op 3.8971 s/op 0.82
compare each validator Uint8Array 1.8484 s/op 1.7573 s/op 1.05
compare ViewDU to Uint8Array 980.00 ms/op 1.7299 s/op 0.57
migrate state 1000000 validators, 24 modified, 0 new 619.76 ms/op 923.20 ms/op 0.67
migrate state 1000000 validators, 1700 modified, 1000 new 846.53 ms/op 1.1270 s/op 0.75
migrate state 1000000 validators, 3400 modified, 2000 new 1.0006 s/op 1.3815 s/op 0.72
migrate state 1500000 validators, 24 modified, 0 new 657.95 ms/op 798.31 ms/op 0.82
migrate state 1500000 validators, 1700 modified, 1000 new 906.64 ms/op 1.3431 s/op 0.68
migrate state 1500000 validators, 3400 modified, 2000 new 1.1730 s/op 1.9358 s/op 0.61
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.4900 ns/op 6.2400 ns/op 0.88
state getBlockRootAtSlot - 250000 vs - 7PWei 685.36 ns/op 997.92 ns/op 0.69
computeProposers - vc 250000 8.0752 ms/op 11.167 ms/op 0.72
computeEpochShuffling - vc 250000 104.99 ms/op 126.02 ms/op 0.83
getNextSyncCommittee - vc 250000 130.41 ms/op 225.16 ms/op 0.58
computeSigningRoot for AttestationData 22.104 us/op 33.973 us/op 0.65
hash AttestationData serialized data then Buffer.toString(base64) 1.5868 us/op 1.7382 us/op 0.91
toHexString serialized data 899.45 ns/op 1.3014 us/op 0.69
Buffer.toString(base64) 195.09 ns/op 287.93 ns/op 0.68

by benchmarkbot/action

@twoeths twoeths merged commit a0f2dcc into unstable Jul 11, 2024
21 checks passed
@twoeths twoeths deleted the cayman/get-slot-from-offset branch July 11, 2024 06:20
@wemeetagain
Copy link
Member Author

🎉 This PR is included in v1.21.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