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: reduce getSingleTrueBit() calls #7209

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Oct 30, 2024

Motivation

  • getSingleTrueBit() is called during attestation validation and in opPool while it is not simple:
getSingleTrueBit(): number | null {
    let index: number | null = null;

    const bytes = this.uint8Array;

    // Iterate over each byte of bits
    for (let iByte = 0, byteLen = bytes.length; iByte < byteLen; iByte++) {
      // If it's exactly zero, there won't be any indexes, continue early
      if (bytes[iByte] === 0) {
        continue;
      }

      // Get the precomputed boolean array for this byte
      const booleansInByte = getUint8ByteToBitBooleanArray(bytes[iByte]);
      // For each bit in the byte check participation and add to indexesSelected array
      for (let iBit = 0; iBit < 8; iBit++) {
        if (booleansInByte[iBit] === true) {
          if (index !== null) {
            // ERROR_MORE_THAN_ONE_BIT_SET
            return null;
          }

          index = iByte * 8 + iBit;
        }
      }
    }

    if (index === null) {
      // ERROR_NO_BIT_SET
      return null;
    } else {
      return index;
    }
  }

Description

  • cache participationIndex as a result of attestation validation, so we don't have to extract it inside opPool

found when investigating #7206

Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.

Project coverage is 49.20%. Comparing base (558ec2f) to head (7d3d255).

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #7209      +/-   ##
============================================
- Coverage     49.21%   49.20%   -0.01%     
============================================
  Files           598      598              
  Lines         39803    39810       +7     
  Branches       2102     2104       +2     
============================================
+ Hits          19588    19589       +1     
- Misses        20175    20181       +6     
  Partials         40       40              

Copy link
Contributor

Performance Report

✔️ no performance regression detected

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 5929bfe Previous: 558ec2f Ratio
forkChoice updateHead vc 600000 bc 64 eq 300000 14.167 ms/op 51.362 ms/op 0.28
Full benchmark results
Benchmark suite Current: 5929bfe Previous: 558ec2f Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.0340 ms/op 1.8128 ms/op 1.12
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 44.500 us/op 48.881 us/op 0.91
BLS verify - blst 1.3645 ms/op 834.47 us/op 1.64
BLS verifyMultipleSignatures 3 - blst 1.5493 ms/op 1.2204 ms/op 1.27
BLS verifyMultipleSignatures 8 - blst 2.4924 ms/op 1.6628 ms/op 1.50
BLS verifyMultipleSignatures 32 - blst 6.7840 ms/op 4.8985 ms/op 1.38
BLS verifyMultipleSignatures 64 - blst 10.524 ms/op 8.8855 ms/op 1.18
BLS verifyMultipleSignatures 128 - blst 17.133 ms/op 17.142 ms/op 1.00
BLS deserializing 10000 signatures 686.24 ms/op 681.01 ms/op 1.01
BLS deserializing 100000 signatures 6.8850 s/op 6.9392 s/op 0.99
BLS verifyMultipleSignatures - same message - 3 - blst 882.55 us/op 944.15 us/op 0.93
BLS verifyMultipleSignatures - same message - 8 - blst 1.1669 ms/op 1.1259 ms/op 1.04
BLS verifyMultipleSignatures - same message - 32 - blst 1.8796 ms/op 1.8836 ms/op 1.00
BLS verifyMultipleSignatures - same message - 64 - blst 2.7235 ms/op 2.7701 ms/op 0.98
BLS verifyMultipleSignatures - same message - 128 - blst 4.3914 ms/op 4.4765 ms/op 0.98
BLS aggregatePubkeys 32 - blst 19.001 us/op 20.853 us/op 0.91
BLS aggregatePubkeys 128 - blst 68.164 us/op 72.497 us/op 0.94
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 71.742 ms/op 57.309 ms/op 1.25
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 55.234 ms/op 57.738 ms/op 0.96
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 50.999 ms/op 52.412 ms/op 0.97
getSlashingsAndExits - default max 91.075 us/op 106.19 us/op 0.86
getSlashingsAndExits - 2k 281.77 us/op 328.95 us/op 0.86
proposeBlockBody type=full, size=empty 6.0141 ms/op 7.6912 ms/op 0.78
isKnown best case - 1 super set check 289.00 ns/op 491.00 ns/op 0.59
isKnown normal case - 2 super set checks 271.00 ns/op 447.00 ns/op 0.61
isKnown worse case - 16 super set checks 269.00 ns/op 477.00 ns/op 0.56
InMemoryCheckpointStateCache - add get delete 2.5910 us/op 3.4140 us/op 0.76
updateUnfinalizedPubkeys - updating 10 pubkeys 925.20 us/op 1.4364 ms/op 0.64
updateUnfinalizedPubkeys - updating 100 pubkeys 3.5141 ms/op 3.8202 ms/op 0.92
updateUnfinalizedPubkeys - updating 1000 pubkeys 50.076 ms/op 58.064 ms/op 0.86
validate api signedAggregateAndProof - struct 2.5329 ms/op 1.5093 ms/op 1.68
validate gossip signedAggregateAndProof - struct 2.5743 ms/op 1.5061 ms/op 1.71
batch validate gossip attestation - vc 640000 - chunk 32 134.41 us/op 156.58 us/op 0.86
batch validate gossip attestation - vc 640000 - chunk 64 120.68 us/op 143.72 us/op 0.84
batch validate gossip attestation - vc 640000 - chunk 128 116.10 us/op 136.83 us/op 0.85
batch validate gossip attestation - vc 640000 - chunk 256 106.31 us/op 134.85 us/op 0.79
pickEth1Vote - no votes 1.0898 ms/op 1.3662 ms/op 0.80
pickEth1Vote - max votes 6.3578 ms/op 8.8989 ms/op 0.71
pickEth1Vote - Eth1Data hashTreeRoot value x2048 14.765 ms/op 21.928 ms/op 0.67
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 21.068 ms/op 32.162 ms/op 0.66
pickEth1Vote - Eth1Data fastSerialize value x2048 464.08 us/op 605.68 us/op 0.77
pickEth1Vote - Eth1Data fastSerialize tree x2048 3.6399 ms/op 3.4028 ms/op 1.07
bytes32 toHexString 449.00 ns/op 649.00 ns/op 0.69
bytes32 Buffer.toString(hex) 261.00 ns/op 302.00 ns/op 0.86
bytes32 Buffer.toString(hex) from Uint8Array 387.00 ns/op 519.00 ns/op 0.75
bytes32 Buffer.toString(hex) + 0x 263.00 ns/op 289.00 ns/op 0.91
Object access 1 prop 0.14500 ns/op 0.19700 ns/op 0.74
Map access 1 prop 0.13500 ns/op 0.16300 ns/op 0.83
Object get x1000 6.1600 ns/op 7.3500 ns/op 0.84
Map get x1000 6.7580 ns/op 7.0140 ns/op 0.96
Object set x1000 34.804 ns/op 56.050 ns/op 0.62
Map set x1000 23.477 ns/op 40.295 ns/op 0.58
Return object 10000 times 0.31860 ns/op 0.35680 ns/op 0.89
Throw Error 10000 times 3.4214 us/op 4.4255 us/op 0.77
toHex 153.32 ns/op 224.74 ns/op 0.68
Buffer.from 143.62 ns/op 197.41 ns/op 0.73
shared Buffer 88.860 ns/op 113.30 ns/op 0.78
fastMsgIdFn sha256 / 200 bytes 2.3980 us/op 2.6630 us/op 0.90
fastMsgIdFn h32 xxhash / 200 bytes 231.00 ns/op 330.00 ns/op 0.70
fastMsgIdFn h64 xxhash / 200 bytes 270.00 ns/op 317.00 ns/op 0.85
fastMsgIdFn sha256 / 1000 bytes 7.5750 us/op 8.5910 us/op 0.88
fastMsgIdFn h32 xxhash / 1000 bytes 370.00 ns/op 474.00 ns/op 0.78
fastMsgIdFn h64 xxhash / 1000 bytes 344.00 ns/op 386.00 ns/op 0.89
fastMsgIdFn sha256 / 10000 bytes 65.904 us/op 74.776 us/op 0.88
fastMsgIdFn h32 xxhash / 10000 bytes 1.9420 us/op 2.0920 us/op 0.93
fastMsgIdFn h64 xxhash / 10000 bytes 1.2750 us/op 1.3560 us/op 0.94
send data - 1000 256B messages 12.935 ms/op 16.075 ms/op 0.80
send data - 1000 512B messages 17.357 ms/op 22.137 ms/op 0.78
send data - 1000 1024B messages 25.670 ms/op 35.662 ms/op 0.72
send data - 1000 1200B messages 26.099 ms/op 35.352 ms/op 0.74
send data - 1000 2048B messages 30.111 ms/op 39.380 ms/op 0.76
send data - 1000 4096B messages 30.587 ms/op 40.439 ms/op 0.76
send data - 1000 16384B messages 74.413 ms/op 100.88 ms/op 0.74
send data - 1000 65536B messages 223.39 ms/op 280.37 ms/op 0.80
enrSubnets - fastDeserialize 64 bits 1.0800 us/op 1.6020 us/op 0.67
enrSubnets - ssz BitVector 64 bits 356.00 ns/op 578.00 ns/op 0.62
enrSubnets - fastDeserialize 4 bits 146.00 ns/op 272.00 ns/op 0.54
enrSubnets - ssz BitVector 4 bits 357.00 ns/op 561.00 ns/op 0.64
prioritizePeers score -10:0 att 32-0.1 sync 2-0 156.96 us/op 222.93 us/op 0.70
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 174.99 us/op 222.18 us/op 0.79
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 238.39 us/op 439.87 us/op 0.54
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 491.97 us/op 476.52 us/op 1.03
prioritizePeers score 0:0 att 64-1 sync 4-1 744.45 us/op 1.0838 ms/op 0.69
array of 16000 items push then shift 1.6752 us/op 1.8060 us/op 0.93
LinkedList of 16000 items push then shift 7.6090 ns/op 10.100 ns/op 0.75
array of 16000 items push then pop 133.90 ns/op 199.87 ns/op 0.67
LinkedList of 16000 items push then pop 7.2300 ns/op 13.962 ns/op 0.52
array of 24000 items push then shift 2.4367 us/op 2.9061 us/op 0.84
LinkedList of 24000 items push then shift 7.4250 ns/op 13.565 ns/op 0.55
array of 24000 items push then pop 162.31 ns/op 223.89 ns/op 0.72
LinkedList of 24000 items push then pop 7.2610 ns/op 11.656 ns/op 0.62
intersect bitArray bitLen 8 6.4280 ns/op 10.494 ns/op 0.61
intersect array and set length 8 46.093 ns/op 117.79 ns/op 0.39
intersect bitArray bitLen 128 30.871 ns/op 38.758 ns/op 0.80
intersect array and set length 128 692.74 ns/op 1.0739 us/op 0.65
bitArray.getTrueBitIndexes() bitLen 128 2.3700 us/op 2.8400 us/op 0.83
bitArray.getTrueBitIndexes() bitLen 248 4.6800 us/op 5.2560 us/op 0.89
bitArray.getTrueBitIndexes() bitLen 512 7.0820 us/op 12.385 us/op 0.57
Buffer.concat 32 items 931.00 ns/op 1.2090 us/op 0.77
Uint8Array.set 32 items 1.8640 us/op 2.0270 us/op 0.92
Buffer.copy 1.7680 us/op 2.4230 us/op 0.73
Uint8Array.set - with subarray 2.4180 us/op 4.2350 us/op 0.57
Uint8Array.set - without subarray 1.3880 us/op 2.0910 us/op 0.66
getUint32 - dataview 230.00 ns/op 389.00 ns/op 0.59
getUint32 - manual 161.00 ns/op 346.00 ns/op 0.47
Set add up to 64 items then delete first 2.3365 us/op 4.2833 us/op 0.55
OrderedSet add up to 64 items then delete first 3.3070 us/op 6.6868 us/op 0.49
Set add up to 64 items then delete last 2.7082 us/op 4.2365 us/op 0.64
OrderedSet add up to 64 items then delete last 4.2711 us/op 6.4645 us/op 0.66
Set add up to 64 items then delete middle 2.7366 us/op 4.2279 us/op 0.65
OrderedSet add up to 64 items then delete middle 5.4596 us/op 7.8873 us/op 0.69
Set add up to 128 items then delete first 5.1819 us/op 8.0824 us/op 0.64
OrderedSet add up to 128 items then delete first 7.6506 us/op 13.715 us/op 0.56
Set add up to 128 items then delete last 5.3540 us/op 8.2653 us/op 0.65
OrderedSet add up to 128 items then delete last 8.1998 us/op 12.790 us/op 0.64
Set add up to 128 items then delete middle 5.3411 us/op 8.6188 us/op 0.62
OrderedSet add up to 128 items then delete middle 14.885 us/op 20.475 us/op 0.73
Set add up to 256 items then delete first 10.636 us/op 16.423 us/op 0.65
OrderedSet add up to 256 items then delete first 16.135 us/op 26.977 us/op 0.60
Set add up to 256 items then delete last 10.389 us/op 17.403 us/op 0.60
OrderedSet add up to 256 items then delete last 15.831 us/op 27.114 us/op 0.58
Set add up to 256 items then delete middle 10.140 us/op 16.606 us/op 0.61
OrderedSet add up to 256 items then delete middle 41.408 us/op 55.088 us/op 0.75
transfer serialized Status (84 B) 1.5320 us/op 1.8380 us/op 0.83
copy serialized Status (84 B) 1.2410 us/op 1.6270 us/op 0.76
transfer serialized SignedVoluntaryExit (112 B) 1.7530 us/op 1.9820 us/op 0.88
copy serialized SignedVoluntaryExit (112 B) 1.2950 us/op 1.6490 us/op 0.79
transfer serialized ProposerSlashing (416 B) 2.5510 us/op 2.5680 us/op 0.99
copy serialized ProposerSlashing (416 B) 1.9210 us/op 2.5680 us/op 0.75
transfer serialized Attestation (485 B) 2.2040 us/op 2.2250 us/op 0.99
copy serialized Attestation (485 B) 1.8620 us/op 2.2090 us/op 0.84
transfer serialized AttesterSlashing (33232 B) 2.4080 us/op 2.4770 us/op 0.97
copy serialized AttesterSlashing (33232 B) 5.8460 us/op 14.131 us/op 0.41
transfer serialized Small SignedBeaconBlock (128000 B) 2.5650 us/op 3.6240 us/op 0.71
copy serialized Small SignedBeaconBlock (128000 B) 16.697 us/op 48.689 us/op 0.34
transfer serialized Avg SignedBeaconBlock (200000 B) 3.6620 us/op 4.7570 us/op 0.77
copy serialized Avg SignedBeaconBlock (200000 B) 23.426 us/op 47.247 us/op 0.50
transfer serialized BlobsSidecar (524380 B) 3.6370 us/op 4.6720 us/op 0.78
copy serialized BlobsSidecar (524380 B) 79.837 us/op 182.30 us/op 0.44
transfer serialized Big SignedBeaconBlock (1000000 B) 3.2650 us/op 12.202 us/op 0.27
copy serialized Big SignedBeaconBlock (1000000 B) 165.05 us/op 322.74 us/op 0.51
pass gossip attestations to forkchoice per slot 2.9107 ms/op 3.7746 ms/op 0.77
forkChoice updateHead vc 100000 bc 64 eq 0 464.11 us/op 658.45 us/op 0.70
forkChoice updateHead vc 600000 bc 64 eq 0 2.8587 ms/op 4.6199 ms/op 0.62
forkChoice updateHead vc 1000000 bc 64 eq 0 4.9988 ms/op 7.3518 ms/op 0.68
forkChoice updateHead vc 600000 bc 320 eq 0 2.8348 ms/op 4.2606 ms/op 0.67
forkChoice updateHead vc 600000 bc 1200 eq 0 2.8915 ms/op 5.0303 ms/op 0.57
forkChoice updateHead vc 600000 bc 7200 eq 0 3.7841 ms/op 5.8325 ms/op 0.65
forkChoice updateHead vc 600000 bc 64 eq 1000 10.427 ms/op 11.727 ms/op 0.89
forkChoice updateHead vc 600000 bc 64 eq 10000 10.455 ms/op 12.161 ms/op 0.86
forkChoice updateHead vc 600000 bc 64 eq 300000 14.167 ms/op 51.362 ms/op 0.28
computeDeltas 500000 validators 300 proto nodes 4.2083 ms/op 5.7635 ms/op 0.73
computeDeltas 500000 validators 1200 proto nodes 4.1215 ms/op 4.5034 ms/op 0.92
computeDeltas 500000 validators 7200 proto nodes 4.0817 ms/op 4.3393 ms/op 0.94
computeDeltas 750000 validators 300 proto nodes 5.9872 ms/op 6.3750 ms/op 0.94
computeDeltas 750000 validators 1200 proto nodes 6.1146 ms/op 6.2290 ms/op 0.98
computeDeltas 750000 validators 7200 proto nodes 6.2313 ms/op 6.2800 ms/op 0.99
computeDeltas 1400000 validators 300 proto nodes 11.776 ms/op 11.346 ms/op 1.04
computeDeltas 1400000 validators 1200 proto nodes 11.632 ms/op 11.980 ms/op 0.97
computeDeltas 1400000 validators 7200 proto nodes 11.578 ms/op 11.762 ms/op 0.98
computeDeltas 2100000 validators 300 proto nodes 17.391 ms/op 16.862 ms/op 1.03
computeDeltas 2100000 validators 1200 proto nodes 17.463 ms/op 17.571 ms/op 0.99
computeDeltas 2100000 validators 7200 proto nodes 17.869 ms/op 17.535 ms/op 1.02
altair processAttestation - 250000 vs - 7PWei normalcase 1.8227 ms/op 2.0283 ms/op 0.90
altair processAttestation - 250000 vs - 7PWei worstcase 2.7246 ms/op 3.9519 ms/op 0.69
altair processAttestation - setStatus - 1/6 committees join 124.57 us/op 106.39 us/op 1.17
altair processAttestation - setStatus - 1/3 committees join 251.86 us/op 180.57 us/op 1.39
altair processAttestation - setStatus - 1/2 committees join 334.66 us/op 255.89 us/op 1.31
altair processAttestation - setStatus - 2/3 committees join 433.08 us/op 363.91 us/op 1.19
altair processAttestation - setStatus - 4/5 committees join 621.08 us/op 492.84 us/op 1.26
altair processAttestation - setStatus - 100% committees join 742.81 us/op 607.37 us/op 1.22
altair processBlock - 250000 vs - 7PWei normalcase 5.6128 ms/op 8.5337 ms/op 0.66
altair processBlock - 250000 vs - 7PWei normalcase hashState 29.612 ms/op 28.307 ms/op 1.05
altair processBlock - 250000 vs - 7PWei worstcase 41.195 ms/op 42.287 ms/op 0.97
altair processBlock - 250000 vs - 7PWei worstcase hashState 83.656 ms/op 77.951 ms/op 1.07
phase0 processBlock - 250000 vs - 7PWei normalcase 2.2685 ms/op 2.1719 ms/op 1.04
phase0 processBlock - 250000 vs - 7PWei worstcase 26.042 ms/op 23.994 ms/op 1.09
altair processEth1Data - 250000 vs - 7PWei normalcase 322.11 us/op 509.83 us/op 0.63
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 6.7960 us/op 7.7840 us/op 0.87
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 41.223 us/op 48.967 us/op 0.84
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 11.379 us/op 11.586 us/op 0.98
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 6.6160 us/op 8.5950 us/op 0.77
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 122.00 us/op 171.23 us/op 0.71
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.5908 ms/op 1.2241 ms/op 1.30
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.8956 ms/op 1.6217 ms/op 1.79
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.7714 ms/op 1.6701 ms/op 1.06
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.8814 ms/op 4.1393 ms/op 0.94
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.9689 ms/op 1.6666 ms/op 1.18
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.0913 ms/op 4.2471 ms/op 0.96
Tree 40 250000 create 228.03 ms/op 272.95 ms/op 0.84
Tree 40 250000 get(125000) 143.61 ns/op 163.93 ns/op 0.88
Tree 40 250000 set(125000) 646.53 ns/op 747.66 ns/op 0.86
Tree 40 250000 toArray() 15.509 ms/op 22.922 ms/op 0.68
Tree 40 250000 iterate all - toArray() + loop 15.685 ms/op 23.477 ms/op 0.67
Tree 40 250000 iterate all - get(i) 51.191 ms/op 65.546 ms/op 0.78
Array 250000 create 3.0013 ms/op 4.0295 ms/op 0.74
Array 250000 clone - spread 1.4330 ms/op 1.8829 ms/op 0.76
Array 250000 get(125000) 0.41300 ns/op 0.48300 ns/op 0.86
Array 250000 set(125000) 0.43100 ns/op 0.49400 ns/op 0.87
Array 250000 iterate all - loop 83.139 us/op 117.91 us/op 0.71
phase0 afterProcessEpoch - 250000 vs - 7PWei 50.835 ms/op 56.505 ms/op 0.90
Array.fill - length 1000000 3.5412 ms/op 4.5277 ms/op 0.78
Array push - length 1000000 16.624 ms/op 19.962 ms/op 0.83
Array.get 0.27677 ns/op 0.30565 ns/op 0.91
Uint8Array.get 0.44563 ns/op 0.47308 ns/op 0.94
phase0 beforeProcessEpoch - 250000 vs - 7PWei 20.721 ms/op 21.472 ms/op 0.97
altair processEpoch - mainnet_e81889 313.47 ms/op 336.82 ms/op 0.93
mainnet_e81889 - altair beforeProcessEpoch 17.946 ms/op 23.500 ms/op 0.76
mainnet_e81889 - altair processJustificationAndFinalization 20.075 us/op 18.573 us/op 1.08
mainnet_e81889 - altair processInactivityUpdates 5.2594 ms/op 7.2852 ms/op 0.72
mainnet_e81889 - altair processRewardsAndPenalties 56.758 ms/op 43.194 ms/op 1.31
mainnet_e81889 - altair processRegistryUpdates 2.7380 us/op 2.5270 us/op 1.08
mainnet_e81889 - altair processSlashings 592.00 ns/op 516.00 ns/op 1.15
mainnet_e81889 - altair processEth1DataReset 505.00 ns/op 548.00 ns/op 0.92
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.9317 ms/op 1.5290 ms/op 1.26
mainnet_e81889 - altair processSlashingsReset 3.8170 us/op 5.5320 us/op 0.69
mainnet_e81889 - altair processRandaoMixesReset 5.8410 us/op 11.046 us/op 0.53
mainnet_e81889 - altair processHistoricalRootsUpdate 775.00 ns/op 755.00 ns/op 1.03
mainnet_e81889 - altair processParticipationFlagUpdates 3.2690 us/op 3.9910 us/op 0.82
mainnet_e81889 - altair processSyncCommitteeUpdates 774.00 ns/op 836.00 ns/op 0.93
mainnet_e81889 - altair afterProcessEpoch 52.169 ms/op 54.902 ms/op 0.95
capella processEpoch - mainnet_e217614 1.0532 s/op 1.1815 s/op 0.89
mainnet_e217614 - capella beforeProcessEpoch 79.490 ms/op 81.092 ms/op 0.98
mainnet_e217614 - capella processJustificationAndFinalization 16.441 us/op 19.352 us/op 0.85
mainnet_e217614 - capella processInactivityUpdates 18.311 ms/op 19.617 ms/op 0.93
mainnet_e217614 - capella processRewardsAndPenalties 247.80 ms/op 255.82 ms/op 0.97
mainnet_e217614 - capella processRegistryUpdates 20.997 us/op 22.312 us/op 0.94
mainnet_e217614 - capella processSlashings 451.00 ns/op 1.1270 us/op 0.40
mainnet_e217614 - capella processEth1DataReset 490.00 ns/op 719.00 ns/op 0.68
mainnet_e217614 - capella processEffectiveBalanceUpdates 16.581 ms/op 18.669 ms/op 0.89
mainnet_e217614 - capella processSlashingsReset 4.4080 us/op 6.0880 us/op 0.72
mainnet_e217614 - capella processRandaoMixesReset 10.251 us/op 12.248 us/op 0.84
mainnet_e217614 - capella processHistoricalRootsUpdate 590.00 ns/op 1.1470 us/op 0.51
mainnet_e217614 - capella processParticipationFlagUpdates 2.8240 us/op 3.5780 us/op 0.79
mainnet_e217614 - capella afterProcessEpoch 130.82 ms/op 131.83 ms/op 0.99
phase0 processEpoch - mainnet_e58758 384.41 ms/op 367.03 ms/op 1.05
mainnet_e58758 - phase0 beforeProcessEpoch 90.483 ms/op 102.91 ms/op 0.88
mainnet_e58758 - phase0 processJustificationAndFinalization 15.946 us/op 22.999 us/op 0.69
mainnet_e58758 - phase0 processRewardsAndPenalties 34.324 ms/op 30.964 ms/op 1.11
mainnet_e58758 - phase0 processRegistryUpdates 10.550 us/op 12.023 us/op 0.88
mainnet_e58758 - phase0 processSlashings 418.00 ns/op 600.00 ns/op 0.70
mainnet_e58758 - phase0 processEth1DataReset 323.00 ns/op 1.4260 us/op 0.23
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.5861 ms/op 1.4508 ms/op 1.09
mainnet_e58758 - phase0 processSlashingsReset 3.2500 us/op 5.7440 us/op 0.57
mainnet_e58758 - phase0 processRandaoMixesReset 4.9580 us/op 8.4070 us/op 0.59
mainnet_e58758 - phase0 processHistoricalRootsUpdate 587.00 ns/op 1.1300 us/op 0.52
mainnet_e58758 - phase0 processParticipationRecordUpdates 5.2730 us/op 6.4070 us/op 0.82
mainnet_e58758 - phase0 afterProcessEpoch 46.793 ms/op 49.570 ms/op 0.94
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.2961 ms/op 1.7527 ms/op 1.31
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.2924 ms/op 2.2092 ms/op 1.04
altair processInactivityUpdates - 250000 normalcase 17.207 ms/op 19.631 ms/op 0.88
altair processInactivityUpdates - 250000 worstcase 17.530 ms/op 20.415 ms/op 0.86
phase0 processRegistryUpdates - 250000 normalcase 7.3290 us/op 12.897 us/op 0.57
phase0 processRegistryUpdates - 250000 badcase_full_deposits 353.14 us/op 356.66 us/op 0.99
phase0 processRegistryUpdates - 250000 worstcase 0.5 128.65 ms/op 122.76 ms/op 1.05
altair processRewardsAndPenalties - 250000 normalcase 43.729 ms/op 44.413 ms/op 0.98
altair processRewardsAndPenalties - 250000 worstcase 41.522 ms/op 51.845 ms/op 0.80
phase0 getAttestationDeltas - 250000 normalcase 10.017 ms/op 9.8066 ms/op 1.02
phase0 getAttestationDeltas - 250000 worstcase 8.4683 ms/op 10.437 ms/op 0.81
phase0 processSlashings - 250000 worstcase 121.30 us/op 121.22 us/op 1.00
altair processSyncCommitteeUpdates - 250000 141.00 ms/op 178.84 ms/op 0.79
BeaconState.hashTreeRoot - No change 330.00 ns/op 401.00 ns/op 0.82
BeaconState.hashTreeRoot - 1 full validator 122.06 us/op 136.48 us/op 0.89
BeaconState.hashTreeRoot - 32 full validator 1.0832 ms/op 1.2506 ms/op 0.87
BeaconState.hashTreeRoot - 512 full validator 13.493 ms/op 12.324 ms/op 1.09
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 150.08 us/op 151.26 us/op 0.99
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.5352 ms/op 1.7160 ms/op 1.48
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 32.023 ms/op 22.434 ms/op 1.43
BeaconState.hashTreeRoot - 1 balances 142.18 us/op 107.03 us/op 1.33
BeaconState.hashTreeRoot - 32 balances 971.76 us/op 1.3836 ms/op 0.70
BeaconState.hashTreeRoot - 512 balances 8.8375 ms/op 9.8484 ms/op 0.90
BeaconState.hashTreeRoot - 250000 balances 180.73 ms/op 161.79 ms/op 1.12
aggregationBits - 2048 els - zipIndexesInBitList 34.265 us/op 32.695 us/op 1.05
byteArrayEquals 32 55.579 ns/op 58.961 ns/op 0.94
Buffer.compare 32 17.801 ns/op 19.646 ns/op 0.91
byteArrayEquals 1024 1.6462 us/op 1.7849 us/op 0.92
Buffer.compare 1024 26.431 ns/op 27.787 ns/op 0.95
byteArrayEquals 16384 26.179 us/op 27.154 us/op 0.96
Buffer.compare 16384 220.53 ns/op 216.25 ns/op 1.02
byteArrayEquals 123687377 207.42 ms/op 195.98 ms/op 1.06
Buffer.compare 123687377 10.573 ms/op 7.8371 ms/op 1.35
byteArrayEquals 32 - diff last byte 56.895 ns/op 53.895 ns/op 1.06
Buffer.compare 32 - diff last byte 18.341 ns/op 17.629 ns/op 1.04
byteArrayEquals 1024 - diff last byte 1.6903 us/op 1.6263 us/op 1.04
Buffer.compare 1024 - diff last byte 27.671 ns/op 26.045 ns/op 1.06
byteArrayEquals 16384 - diff last byte 26.561 us/op 25.868 us/op 1.03
Buffer.compare 16384 - diff last byte 216.84 ns/op 185.91 ns/op 1.17
byteArrayEquals 123687377 - diff last byte 199.63 ms/op 194.06 ms/op 1.03
Buffer.compare 123687377 - diff last byte 7.1795 ms/op 6.8421 ms/op 1.05
byteArrayEquals 32 - random bytes 5.2330 ns/op 5.3570 ns/op 0.98
Buffer.compare 32 - random bytes 17.350 ns/op 17.470 ns/op 0.99
byteArrayEquals 1024 - random bytes 5.1930 ns/op 5.5210 ns/op 0.94
Buffer.compare 1024 - random bytes 17.372 ns/op 17.806 ns/op 0.98
byteArrayEquals 16384 - random bytes 5.2030 ns/op 5.3590 ns/op 0.97
Buffer.compare 16384 - random bytes 17.373 ns/op 17.769 ns/op 0.98
byteArrayEquals 123687377 - random bytes 6.4700 ns/op 6.7500 ns/op 0.96
Buffer.compare 123687377 - random bytes 18.620 ns/op 19.060 ns/op 0.98
regular array get 100000 times 43.531 us/op 45.107 us/op 0.97
wrappedArray get 100000 times 33.066 us/op 33.966 us/op 0.97
arrayWithProxy get 100000 times 13.241 ms/op 15.348 ms/op 0.86
ssz.Root.equals 46.221 ns/op 48.114 ns/op 0.96
byteArrayEquals 45.779 ns/op 46.071 ns/op 0.99
Buffer.compare 11.919 ns/op 10.431 ns/op 1.14
processSlot - 1 slots 12.128 us/op 16.621 us/op 0.73
processSlot - 32 slots 2.3578 ms/op 3.0612 ms/op 0.77
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 39.735 ms/op 38.334 ms/op 1.04
getCommitteeAssignments - req 1 vs - 250000 vc 2.1242 ms/op 2.2818 ms/op 0.93
getCommitteeAssignments - req 100 vs - 250000 vc 4.1374 ms/op 4.3758 ms/op 0.95
getCommitteeAssignments - req 1000 vs - 250000 vc 4.4969 ms/op 4.6412 ms/op 0.97
findModifiedValidators - 10000 modified validators 262.85 ms/op 287.27 ms/op 0.92
findModifiedValidators - 1000 modified validators 165.32 ms/op 204.34 ms/op 0.81
findModifiedValidators - 100 modified validators 139.84 ms/op 205.72 ms/op 0.68
findModifiedValidators - 10 modified validators 144.30 ms/op 215.93 ms/op 0.67
findModifiedValidators - 1 modified validators 147.74 ms/op 195.48 ms/op 0.76
findModifiedValidators - no difference 155.33 ms/op 198.21 ms/op 0.78
compare ViewDUs 3.2195 s/op 3.4022 s/op 0.95
compare each validator Uint8Array 1.8288 s/op 1.5343 s/op 1.19
compare ViewDU to Uint8Array 985.44 ms/op 1.2391 s/op 0.80
migrate state 1000000 validators, 24 modified, 0 new 777.14 ms/op 760.93 ms/op 1.02
migrate state 1000000 validators, 1700 modified, 1000 new 1.0356 s/op 952.66 ms/op 1.09
migrate state 1000000 validators, 3400 modified, 2000 new 1.2603 s/op 1.1375 s/op 1.11
migrate state 1500000 validators, 24 modified, 0 new 786.73 ms/op 707.30 ms/op 1.11
migrate state 1500000 validators, 1700 modified, 1000 new 1.0606 s/op 862.99 ms/op 1.23
migrate state 1500000 validators, 3400 modified, 2000 new 1.2790 s/op 981.79 ms/op 1.30
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.2600 ns/op 4.4300 ns/op 0.96
state getBlockRootAtSlot - 250000 vs - 7PWei 742.08 ns/op 586.48 ns/op 1.27
computeProposers - vc 250000 7.0302 ms/op 7.1967 ms/op 0.98
computeEpochShuffling - vc 250000 42.612 ms/op 42.083 ms/op 1.01
getNextSyncCommittee - vc 250000 129.81 ms/op 123.04 ms/op 1.06
computeSigningRoot for AttestationData 26.641 us/op 23.016 us/op 1.16
hash AttestationData serialized data then Buffer.toString(base64) 1.5316 us/op 1.5359 us/op 1.00
toHexString serialized data 867.66 ns/op 871.52 ns/op 1.00
Buffer.toString(base64) 167.81 ns/op 171.00 ns/op 0.98
nodejs block root to RootHex using toHex 166.34 ns/op 164.45 ns/op 1.01
nodejs block root to RootHex using toRootHex 90.071 ns/op 92.257 ns/op 0.98
browser block root to RootHex using the deprecated toHexString 225.52 ns/op 225.50 ns/op 1.00
browser block root to RootHex using toHex 180.01 ns/op 186.09 ns/op 0.97
browser block root to RootHex using toRootHex 160.92 ns/op 160.59 ns/op 1.00

by benchmarkbot/action

@twoeths twoeths marked this pull request as ready for review October 30, 2024 09:59
@twoeths twoeths requested a review from a team as a code owner October 30, 2024 09:59
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.

1 participant