Skip to content

Commit

Permalink
test: enable coredump for the unit tests (#6107)
Browse files Browse the repository at this point in the history
* Add support for core dump

* Increase the ulimit for the debugger

* Refactor the action steps as tasks

* Refactor the action steps as tasks

* Update the action path

* Update the action path

* Fix the syntax error

* Fix the conditions
  • Loading branch information
nazarhussain authored Nov 24, 2023
1 parent 3f3a207 commit 228d7ba
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 5 deletions.
13 changes: 13 additions & 0 deletions .github/actions/core-dump/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'Take core dump files'
description: 'List down and upload core dumps as artifacts'
runs:
using: "composite"
steps:
- run: ls -l
shell: sh

- name: Backup core dump
uses: actions/upload-artifact@v2
with:
name: core-dump
path: core.*
39 changes: 39 additions & 0 deletions .github/actions/setup-debug-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Setup node with debug support'
description: 'Setup the nodejs version with debug support'
inputs:
node-version:
description: 'Version of nodejs'
required: true
default: '20'
debug:
description: Enable the debug version
required: true
default: 'false'

runs:
using: "composite"
steps:
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
check-latest: true
cache: yarn

# For now we only have the Node 20 debug build
- run: sudo apt-get install unzip && curl -L "https://drive.google.com/uc?export=download&id=1hlhbbQi-NJi8_WjULvOdo-K_tfZFzN3Z&confirm=t" > nodejs.zip && unzip nodejs.zip
shell: sh
if: ${{ inputs.debug == 'true' }}
- run: sudo cp -f node $(which node)
shell: sh
if: ${{ inputs.debug == 'true' }}
- run: sudo sh -c "ulimit -c unlimited"
shell: sh
if: ${{ inputs.debug == 'true' }}
- run: sudo sh -c "echo core > /proc/sys/kernel/core_pattern"
shell: sh
if: ${{ inputs.debug == 'true' }}
- run: echo $(node --print "process.version")
shell: sh
- run: echo $(node --print "process.features.debug")
shell: sh

15 changes: 10 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ jobs:
matrix:
node: [20]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
- uses: actions/checkout@v3
- uses: './.github/actions/setup-debug-node'
with:
node-version: ${{matrix.node}}
check-latest: true
cache: yarn
debug: 'true'

- name: Restore build cache
id: cache-primes-restore
uses: actions/cache/restore@v3
Expand All @@ -180,7 +180,12 @@ jobs:
key: spec-test-data-${{ hashFiles('packages/validator/test/spec/params.ts') }}

- name: Unit tests
id: unit_tests
run: yarn test:unit

- uses: './.github/actions/core-dump'
if: ${{ failure() && steps.unit_tests.conclusion == 'failure' }}

- name: Upload coverage data
run: yarn coverage

Expand Down

1 comment on commit 228d7ba

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for some benchmarks.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold.

Benchmark suite Current: 228d7ba Previous: 3f3a207 Ratio
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 286.85 us/op 86.541 us/op 3.31
BLS verifyMultipleSignatures - same message - 3 - blst-native 4.0886 ms/op 1.3273 ms/op 3.08
isKnown normal case - 2 super set checks 1.1560 us/op 333.00 ns/op 3.47
isKnown worse case - 16 super set checks 1.1270 us/op 357.00 ns/op 3.16
prioritizePeers score 0:0 att 64-1 sync 4-1 1.0940 ms/op 349.41 us/op 3.13
forkChoice updateHead vc 600000 bc 320 eq 0 13.033 ms/op 4.2170 ms/op 3.09
Buffer.compare 123687377 - random bytes 188.84 ns/op 62.910 ns/op 3.00
regular array get 100000 times 129.81 us/op 31.883 us/op 4.07
wrappedArray get 100000 times 116.05 us/op 32.058 us/op 3.62
arrayWithProxy get 100000 times 48.117 ms/op 14.860 ms/op 3.24
computeProposers - vc 250000 33.718 ms/op 10.142 ms/op 3.32
computeEpochShuffling - vc 250000 375.48 ms/op 113.11 ms/op 3.32

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 228d7ba Previous: 3f3a207 Ratio
enrSubnets - fastDeserialize 64 bits 1.5340 us/op 5.7000 us/op 0.27
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 10.777 us/op 38.432 us/op 0.28
Full benchmark results
Benchmark suite Current: 228d7ba Previous: 3f3a207 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.2793 ms/op 683.54 us/op 1.87
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 286.85 us/op 86.541 us/op 3.31
BLS verify - blst-native 2.0145 ms/op 1.3301 ms/op 1.51
BLS verifyMultipleSignatures 3 - blst-native 4.4485 ms/op 2.8189 ms/op 1.58
BLS verifyMultipleSignatures 8 - blst-native 12.157 ms/op 6.1090 ms/op 1.99
BLS verifyMultipleSignatures 32 - blst-native 46.848 ms/op 22.250 ms/op 2.11
BLS verifyMultipleSignatures 64 - blst-native 83.936 ms/op 43.385 ms/op 1.93
BLS verifyMultipleSignatures 128 - blst-native 188.32 ms/op 86.717 ms/op 2.17
BLS deserializing 10000 signatures 2.1329 s/op 933.03 ms/op 2.29
BLS deserializing 100000 signatures 20.274 s/op 9.2264 s/op 2.20
BLS verifyMultipleSignatures - same message - 3 - blst-native 4.0886 ms/op 1.3273 ms/op 3.08
BLS verifyMultipleSignatures - same message - 8 - blst-native 4.3258 ms/op 1.5099 ms/op 2.86
BLS verifyMultipleSignatures - same message - 32 - blst-native 6.3565 ms/op 2.3367 ms/op 2.72
BLS verifyMultipleSignatures - same message - 64 - blst-native 7.3559 ms/op 4.0995 ms/op 1.79
BLS verifyMultipleSignatures - same message - 128 - blst-native 13.935 ms/op 5.6337 ms/op 2.47
BLS aggregatePubkeys 32 - blst-native 56.724 us/op 25.642 us/op 2.21
BLS aggregatePubkeys 128 - blst-native 216.40 us/op 101.12 us/op 2.14
getAttestationsForBlock 92.243 ms/op 46.064 ms/op 2.00
isKnown best case - 1 super set check 1.0160 us/op 375.00 ns/op 2.71
isKnown normal case - 2 super set checks 1.1560 us/op 333.00 ns/op 3.47
isKnown worse case - 16 super set checks 1.1270 us/op 357.00 ns/op 3.16
CheckpointStateCache - add get delete 13.504 us/op 6.0890 us/op 2.22
validate api signedAggregateAndProof - struct 7.6561 ms/op 2.8432 ms/op 2.69
validate gossip signedAggregateAndProof - struct 7.7883 ms/op 2.8665 ms/op 2.72
validate gossip attestation - vc 640000 2.1709 ms/op 1.3839 ms/op 1.57
batch validate gossip attestation - vc 640000 - chunk 32 219.48 us/op 166.50 us/op 1.32
batch validate gossip attestation - vc 640000 - chunk 64 177.04 us/op 150.18 us/op 1.18
batch validate gossip attestation - vc 640000 - chunk 128 175.61 us/op 140.15 us/op 1.25
batch validate gossip attestation - vc 640000 - chunk 256 160.21 us/op 131.25 us/op 1.22
pickEth1Vote - no votes 3.0061 ms/op 1.3789 ms/op 2.18
pickEth1Vote - max votes 21.473 ms/op 12.213 ms/op 1.76
pickEth1Vote - Eth1Data hashTreeRoot value x2048 51.737 ms/op 24.172 ms/op 2.14
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 52.477 ms/op 33.123 ms/op 1.58
pickEth1Vote - Eth1Data fastSerialize value x2048 1.5227 ms/op 728.03 us/op 2.09
pickEth1Vote - Eth1Data fastSerialize tree x2048 10.643 ms/op 6.5572 ms/op 1.62
bytes32 toHexString 1.0300 us/op 629.00 ns/op 1.64
bytes32 Buffer.toString(hex) 746.00 ns/op 311.00 ns/op 2.40
bytes32 Buffer.toString(hex) from Uint8Array 845.00 ns/op 557.00 ns/op 1.52
bytes32 Buffer.toString(hex) + 0x 832.00 ns/op 310.00 ns/op 2.68
Object access 1 prop 0.33800 ns/op 0.19600 ns/op 1.72
Map access 1 prop 0.20500 ns/op 0.15100 ns/op 1.36
Object get x1000 9.2780 ns/op 7.3860 ns/op 1.26
Map get x1000 0.99300 ns/op 0.71100 ns/op 1.40
Object set x1000 72.330 ns/op 62.334 ns/op 1.16
Map set x1000 52.922 ns/op 46.835 ns/op 1.13
Return object 10000 times 0.32910 ns/op 0.25210 ns/op 1.31
Throw Error 10000 times 6.8947 us/op 3.9744 us/op 1.73
fastMsgIdFn sha256 / 200 bytes 5.4470 us/op 3.4330 us/op 1.59
fastMsgIdFn h32 xxhash / 200 bytes 506.00 ns/op 350.00 ns/op 1.45
fastMsgIdFn h64 xxhash / 200 bytes 500.00 ns/op 397.00 ns/op 1.26
fastMsgIdFn sha256 / 1000 bytes 15.182 us/op 11.732 us/op 1.29
fastMsgIdFn h32 xxhash / 1000 bytes 665.00 ns/op 453.00 ns/op 1.47
fastMsgIdFn h64 xxhash / 1000 bytes 523.00 ns/op 460.00 ns/op 1.14
fastMsgIdFn sha256 / 10000 bytes 134.86 us/op 105.50 us/op 1.28
fastMsgIdFn h32 xxhash / 10000 bytes 2.7610 us/op 2.0270 us/op 1.36
fastMsgIdFn h64 xxhash / 10000 bytes 1.9240 us/op 1.3810 us/op 1.39
send data - 1000 256B messages 28.771 ms/op 21.158 ms/op 1.36
send data - 1000 512B messages 30.546 ms/op 28.813 ms/op 1.06
send data - 1000 1024B messages 46.754 ms/op 42.088 ms/op 1.11
send data - 1000 1200B messages 41.375 ms/op 23.386 ms/op 1.77
send data - 1000 2048B messages 53.839 ms/op 23.555 ms/op 2.29
send data - 1000 4096B messages 46.689 ms/op 38.544 ms/op 1.21
send data - 1000 16384B messages 157.79 ms/op 107.05 ms/op 1.47
send data - 1000 65536B messages 616.05 ms/op 444.46 ms/op 1.39
enrSubnets - fastDeserialize 64 bits 1.5340 us/op 5.7000 us/op 0.27
enrSubnets - ssz BitVector 64 bits 717.00 ns/op 476.00 ns/op 1.51
enrSubnets - fastDeserialize 4 bits 276.00 ns/op 186.00 ns/op 1.48
enrSubnets - ssz BitVector 4 bits 789.00 ns/op 512.00 ns/op 1.54
prioritizePeers score -10:0 att 32-0.1 sync 2-0 201.19 us/op 107.94 us/op 1.86
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 254.61 us/op 134.66 us/op 1.89
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 305.56 us/op 165.71 us/op 1.84
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 434.35 us/op 290.95 us/op 1.49
prioritizePeers score 0:0 att 64-1 sync 4-1 1.0940 ms/op 349.41 us/op 3.13
array of 16000 items push then shift 5.4336 us/op 1.6879 us/op 3.22
LinkedList of 16000 items push then shift 26.038 ns/op 9.1170 ns/op 2.86
array of 16000 items push then pop 248.17 ns/op 98.860 ns/op 2.51
LinkedList of 16000 items push then pop 20.424 ns/op 9.0310 ns/op 2.26
array of 24000 items push then shift 3.5034 us/op 2.4477 us/op 1.43
LinkedList of 24000 items push then shift 20.628 ns/op 8.8770 ns/op 2.32
array of 24000 items push then pop 183.44 ns/op 140.33 ns/op 1.31
LinkedList of 24000 items push then pop 19.742 ns/op 8.6950 ns/op 2.27
intersect bitArray bitLen 8 11.961 ns/op 6.9540 ns/op 1.72
intersect array and set length 8 201.60 ns/op 57.657 ns/op 3.50
intersect bitArray bitLen 128 59.077 ns/op 32.138 ns/op 1.84
intersect array and set length 128 1.6688 us/op 771.89 ns/op 2.16
bitArray.getTrueBitIndexes() bitLen 128 4.1480 us/op 1.4340 us/op 2.89
bitArray.getTrueBitIndexes() bitLen 248 5.9990 us/op 2.5220 us/op 2.38
bitArray.getTrueBitIndexes() bitLen 512 8.1550 us/op 4.8530 us/op 1.68
Buffer.concat 32 items 1.9780 us/op 1.0020 us/op 1.97
Uint8Array.set 32 items 2.7890 us/op 2.0520 us/op 1.36
Set add up to 64 items then delete first 8.8781 us/op 4.3633 us/op 2.03
OrderedSet add up to 64 items then delete first 11.004 us/op 5.4480 us/op 2.02
Set add up to 64 items then delete last 9.1450 us/op 4.6660 us/op 1.96
OrderedSet add up to 64 items then delete last 8.2228 us/op 5.8516 us/op 1.41
Set add up to 64 items then delete middle 6.9393 us/op 4.6187 us/op 1.50
OrderedSet add up to 64 items then delete middle 12.723 us/op 7.0530 us/op 1.80
Set add up to 128 items then delete first 19.191 us/op 9.5125 us/op 2.02
OrderedSet add up to 128 items then delete first 27.791 us/op 12.399 us/op 2.24
Set add up to 128 items then delete last 15.349 us/op 9.1572 us/op 1.68
OrderedSet add up to 128 items then delete last 18.709 us/op 11.647 us/op 1.61
Set add up to 128 items then delete middle 13.468 us/op 9.1334 us/op 1.47
OrderedSet add up to 128 items then delete middle 25.230 us/op 16.938 us/op 1.49
Set add up to 256 items then delete first 36.782 us/op 19.081 us/op 1.93
OrderedSet add up to 256 items then delete first 50.961 us/op 25.320 us/op 2.01
Set add up to 256 items then delete last 32.744 us/op 18.251 us/op 1.79
OrderedSet add up to 256 items then delete last 42.607 us/op 23.268 us/op 1.83
Set add up to 256 items then delete middle 30.035 us/op 18.260 us/op 1.64
OrderedSet add up to 256 items then delete middle 95.173 us/op 44.962 us/op 2.12
transfer serialized Status (84 B) 4.5580 us/op 1.9070 us/op 2.39
copy serialized Status (84 B) 2.6250 us/op 1.5710 us/op 1.67
transfer serialized SignedVoluntaryExit (112 B) 4.5280 us/op 2.1670 us/op 2.09
copy serialized SignedVoluntaryExit (112 B) 2.6070 us/op 1.7530 us/op 1.49
transfer serialized ProposerSlashing (416 B) 5.1820 us/op 3.1020 us/op 1.67
copy serialized ProposerSlashing (416 B) 4.2170 us/op 3.0290 us/op 1.39
transfer serialized Attestation (485 B) 5.6290 us/op 3.2740 us/op 1.72
copy serialized Attestation (485 B) 4.4620 us/op 3.0480 us/op 1.46
transfer serialized AttesterSlashing (33232 B) 3.3850 us/op 3.1550 us/op 1.07
copy serialized AttesterSlashing (33232 B) 8.3730 us/op 7.6860 us/op 1.09
transfer serialized Small SignedBeaconBlock (128000 B) 4.7420 us/op 2.5240 us/op 1.88
copy serialized Small SignedBeaconBlock (128000 B) 22.733 us/op 13.770 us/op 1.65
transfer serialized Avg SignedBeaconBlock (200000 B) 4.6660 us/op 2.8790 us/op 1.62
copy serialized Avg SignedBeaconBlock (200000 B) 48.901 us/op 20.274 us/op 2.41
transfer serialized BlobsSidecar (524380 B) 5.0020 us/op 2.8850 us/op 1.73
copy serialized BlobsSidecar (524380 B) 171.09 us/op 93.338 us/op 1.83
transfer serialized Big SignedBeaconBlock (1000000 B) 4.8430 us/op 2.9460 us/op 1.64
copy serialized Big SignedBeaconBlock (1000000 B) 216.66 us/op 322.18 us/op 0.67
pass gossip attestations to forkchoice per slot 4.9564 ms/op 3.8483 ms/op 1.29
forkChoice updateHead vc 100000 bc 64 eq 0 1.2213 ms/op 684.93 us/op 1.78
forkChoice updateHead vc 600000 bc 64 eq 0 9.0866 ms/op 4.1176 ms/op 2.21
forkChoice updateHead vc 1000000 bc 64 eq 0 14.738 ms/op 7.2408 ms/op 2.04
forkChoice updateHead vc 600000 bc 320 eq 0 13.033 ms/op 4.2170 ms/op 3.09
forkChoice updateHead vc 600000 bc 1200 eq 0 10.537 ms/op 4.2290 ms/op 2.49
forkChoice updateHead vc 600000 bc 7200 eq 0 13.679 ms/op 5.4529 ms/op 2.51
forkChoice updateHead vc 600000 bc 64 eq 1000 17.065 ms/op 11.370 ms/op 1.50
forkChoice updateHead vc 600000 bc 64 eq 10000 22.770 ms/op 12.164 ms/op 1.87
forkChoice updateHead vc 600000 bc 64 eq 300000 37.293 ms/op 15.782 ms/op 2.36
computeDeltas 500000 validators 300 proto nodes 12.345 ms/op 6.5587 ms/op 1.88
computeDeltas 500000 validators 1200 proto nodes 12.129 ms/op 6.4303 ms/op 1.89
computeDeltas 500000 validators 7200 proto nodes 11.687 ms/op 6.4520 ms/op 1.81
computeDeltas 750000 validators 300 proto nodes 12.607 ms/op 9.6252 ms/op 1.31
computeDeltas 750000 validators 1200 proto nodes 14.282 ms/op 9.3162 ms/op 1.53
computeDeltas 750000 validators 7200 proto nodes 15.372 ms/op 9.5882 ms/op 1.60
computeDeltas 1400000 validators 300 proto nodes 34.173 ms/op 17.940 ms/op 1.90
computeDeltas 1400000 validators 1200 proto nodes 26.601 ms/op 18.184 ms/op 1.46
computeDeltas 1400000 validators 7200 proto nodes 24.704 ms/op 18.321 ms/op 1.35
computeDeltas 2100000 validators 300 proto nodes 42.052 ms/op 28.035 ms/op 1.50
computeDeltas 2100000 validators 1200 proto nodes 46.550 ms/op 27.804 ms/op 1.67
computeDeltas 2100000 validators 7200 proto nodes 48.894 ms/op 27.508 ms/op 1.78
computeProposerBoostScoreFromBalances 500000 validators 5.2734 ms/op 3.2826 ms/op 1.61
computeProposerBoostScoreFromBalances 750000 validators 4.6572 ms/op 3.2543 ms/op 1.43
computeProposerBoostScoreFromBalances 1400000 validators 4.5115 ms/op 3.2796 ms/op 1.38
computeProposerBoostScoreFromBalances 2100000 validators 4.7575 ms/op 3.3139 ms/op 1.44
altair processAttestation - 250000 vs - 7PWei normalcase 2.4799 ms/op 2.2918 ms/op 1.08
altair processAttestation - 250000 vs - 7PWei worstcase 3.9751 ms/op 3.3844 ms/op 1.17
altair processAttestation - setStatus - 1/6 committees join 239.62 us/op 183.76 us/op 1.30
altair processAttestation - setStatus - 1/3 committees join 352.80 us/op 358.01 us/op 0.99
altair processAttestation - setStatus - 1/2 committees join 494.64 us/op 492.14 us/op 1.01
altair processAttestation - setStatus - 2/3 committees join 718.85 us/op 635.74 us/op 1.13
altair processAttestation - setStatus - 4/5 committees join 1.1924 ms/op 864.90 us/op 1.38
altair processAttestation - setStatus - 100% committees join 918.19 us/op 1.0127 ms/op 0.91
altair processBlock - 250000 vs - 7PWei normalcase 10.672 ms/op 11.197 ms/op 0.95
altair processBlock - 250000 vs - 7PWei normalcase hashState 39.860 ms/op 32.990 ms/op 1.21
altair processBlock - 250000 vs - 7PWei worstcase 49.477 ms/op 44.496 ms/op 1.11
altair processBlock - 250000 vs - 7PWei worstcase hashState 115.81 ms/op 97.452 ms/op 1.19
phase0 processBlock - 250000 vs - 7PWei normalcase 3.1013 ms/op 3.4148 ms/op 0.91
phase0 processBlock - 250000 vs - 7PWei worstcase 37.717 ms/op 34.867 ms/op 1.08
altair processEth1Data - 250000 vs - 7PWei normalcase 641.67 us/op 749.23 us/op 0.86
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 9.2320 us/op 20.886 us/op 0.44
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 61.047 us/op 110.26 us/op 0.55
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 10.777 us/op 38.432 us/op 0.28
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 7.2800 us/op 21.193 us/op 0.34
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 125.37 us/op 213.03 us/op 0.59
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.1915 ms/op 1.6338 ms/op 0.73
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.7921 ms/op 2.8572 ms/op 0.63
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.6155 ms/op 1.8689 ms/op 0.86
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.1693 ms/op 4.1381 ms/op 1.01
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.4276 ms/op 3.0775 ms/op 0.79
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.9340 ms/op 6.9271 ms/op 0.71
Tree 40 250000 create 383.27 ms/op 656.02 ms/op 0.58
Tree 40 250000 get(125000) 222.75 ns/op 245.66 ns/op 0.91
Tree 40 250000 set(125000) 1.1247 us/op 2.0343 us/op 0.55
Tree 40 250000 toArray() 19.066 ms/op 26.924 ms/op 0.71
Tree 40 250000 iterate all - toArray() + loop 19.448 ms/op 38.109 ms/op 0.51
Tree 40 250000 iterate all - get(i) 71.250 ms/op 107.44 ms/op 0.66
MutableVector 250000 create 15.342 ms/op 18.541 ms/op 0.83
MutableVector 250000 get(125000) 7.6430 ns/op 8.3780 ns/op 0.91
MutableVector 250000 set(125000) 302.96 ns/op 768.09 ns/op 0.39
MutableVector 250000 toArray() 3.1669 ms/op 6.3430 ms/op 0.50
MutableVector 250000 iterate all - toArray() + loop 3.3701 ms/op 5.6388 ms/op 0.60
MutableVector 250000 iterate all - get(i) 1.5990 ms/op 1.7961 ms/op 0.89
Array 250000 create 3.0008 ms/op 5.2783 ms/op 0.57
Array 250000 clone - spread 1.4275 ms/op 3.3166 ms/op 0.43
Array 250000 get(125000) 1.1560 ns/op 1.5430 ns/op 0.75
Array 250000 set(125000) 4.3710 ns/op 1.4930 ns/op 2.93
Array 250000 iterate all - loop 187.81 us/op 92.824 us/op 2.02
effectiveBalanceIncrements clone Uint8Array 300000 31.992 us/op 157.24 us/op 0.20
effectiveBalanceIncrements clone MutableVector 300000 437.00 ns/op 355.00 ns/op 1.23
effectiveBalanceIncrements rw all Uint8Array 300000 231.19 us/op 191.83 us/op 1.21
effectiveBalanceIncrements rw all MutableVector 300000 92.403 ms/op 135.30 ms/op 0.68
phase0 afterProcessEpoch - 250000 vs - 7PWei 136.97 ms/op 130.46 ms/op 1.05
phase0 beforeProcessEpoch - 250000 vs - 7PWei 50.846 ms/op 65.481 ms/op 0.78
altair processEpoch - mainnet_e81889 521.30 ms/op 561.96 ms/op 0.93
mainnet_e81889 - altair beforeProcessEpoch 85.816 ms/op 93.719 ms/op 0.92
mainnet_e81889 - altair processJustificationAndFinalization 14.236 us/op 22.172 us/op 0.64
mainnet_e81889 - altair processInactivityUpdates 5.9193 ms/op 10.605 ms/op 0.56
mainnet_e81889 - altair processRewardsAndPenalties 85.992 ms/op 69.287 ms/op 1.24
mainnet_e81889 - altair processRegistryUpdates 2.2520 us/op 5.4630 us/op 0.41
mainnet_e81889 - altair processSlashings 429.00 ns/op 1.2010 us/op 0.36
mainnet_e81889 - altair processEth1DataReset 532.00 ns/op 859.00 ns/op 0.62
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.4700 ms/op 1.5170 ms/op 0.97
mainnet_e81889 - altair processSlashingsReset 2.8280 us/op 3.9340 us/op 0.72
mainnet_e81889 - altair processRandaoMixesReset 4.1180 us/op 6.2770 us/op 0.66
mainnet_e81889 - altair processHistoricalRootsUpdate 765.00 ns/op 854.00 ns/op 0.90
mainnet_e81889 - altair processParticipationFlagUpdates 2.4760 us/op 4.1540 us/op 0.60
mainnet_e81889 - altair processSyncCommitteeUpdates 573.00 ns/op 1.6460 us/op 0.35
mainnet_e81889 - altair afterProcessEpoch 130.22 ms/op 131.35 ms/op 0.99
capella processEpoch - mainnet_e217614 2.1794 s/op 2.4314 s/op 0.90
mainnet_e217614 - capella beforeProcessEpoch 508.45 ms/op 487.93 ms/op 1.04
mainnet_e217614 - capella processJustificationAndFinalization 15.714 us/op 17.150 us/op 0.92
mainnet_e217614 - capella processInactivityUpdates 16.640 ms/op 21.548 ms/op 0.77
mainnet_e217614 - capella processRewardsAndPenalties 549.85 ms/op 516.78 ms/op 1.06
mainnet_e217614 - capella processRegistryUpdates 31.481 us/op 35.416 us/op 0.89
mainnet_e217614 - capella processSlashings 705.00 ns/op 476.00 ns/op 1.48
mainnet_e217614 - capella processEth1DataReset 638.00 ns/op 894.00 ns/op 0.71
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.8903 ms/op 4.2077 ms/op 1.16
mainnet_e217614 - capella processSlashingsReset 2.3390 us/op 2.8300 us/op 0.83
mainnet_e217614 - capella processRandaoMixesReset 4.8020 us/op 5.3330 us/op 0.90
mainnet_e217614 - capella processHistoricalRootsUpdate 661.00 ns/op 745.00 ns/op 0.89
mainnet_e217614 - capella processParticipationFlagUpdates 1.3230 us/op 1.9120 us/op 0.69
mainnet_e217614 - capella afterProcessEpoch 393.00 ms/op 331.03 ms/op 1.19
phase0 processEpoch - mainnet_e58758 549.34 ms/op 436.73 ms/op 1.26
mainnet_e58758 - phase0 beforeProcessEpoch 149.57 ms/op 115.04 ms/op 1.30
mainnet_e58758 - phase0 processJustificationAndFinalization 15.064 us/op 15.354 us/op 0.98
mainnet_e58758 - phase0 processRewardsAndPenalties 69.525 ms/op 66.939 ms/op 1.04
mainnet_e58758 - phase0 processRegistryUpdates 11.364 us/op 9.7620 us/op 1.16
mainnet_e58758 - phase0 processSlashings 485.00 ns/op 554.00 ns/op 0.88
mainnet_e58758 - phase0 processEth1DataReset 433.00 ns/op 520.00 ns/op 0.83
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1023 ms/op 1.0890 ms/op 1.01
mainnet_e58758 - phase0 processSlashingsReset 2.0370 us/op 2.9110 us/op 0.70
mainnet_e58758 - phase0 processRandaoMixesReset 3.9360 us/op 4.5410 us/op 0.87
mainnet_e58758 - phase0 processHistoricalRootsUpdate 606.00 ns/op 1.0580 us/op 0.57
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.1930 us/op 5.3300 us/op 0.79
mainnet_e58758 - phase0 afterProcessEpoch 106.25 ms/op 104.37 ms/op 1.02
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.3620 ms/op 1.2743 ms/op 1.07
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4220 ms/op 1.4933 ms/op 0.95
altair processInactivityUpdates - 250000 normalcase 21.734 ms/op 22.397 ms/op 0.97
altair processInactivityUpdates - 250000 worstcase 25.527 ms/op 26.762 ms/op 0.95
phase0 processRegistryUpdates - 250000 normalcase 8.8990 us/op 10.971 us/op 0.81
phase0 processRegistryUpdates - 250000 badcase_full_deposits 391.62 us/op 457.32 us/op 0.86
phase0 processRegistryUpdates - 250000 worstcase 0.5 143.37 ms/op 133.86 ms/op 1.07
altair processRewardsAndPenalties - 250000 normalcase 80.253 ms/op 72.985 ms/op 1.10
altair processRewardsAndPenalties - 250000 worstcase 78.822 ms/op 72.973 ms/op 1.08
phase0 getAttestationDeltas - 250000 normalcase 12.971 ms/op 12.801 ms/op 1.01
phase0 getAttestationDeltas - 250000 worstcase 11.462 ms/op 11.393 ms/op 1.01
phase0 processSlashings - 250000 worstcase 2.5311 ms/op 2.7034 ms/op 0.94
altair processSyncCommitteeUpdates - 250000 183.49 ms/op 211.09 ms/op 0.87
BeaconState.hashTreeRoot - No change 290.00 ns/op 295.00 ns/op 0.98
BeaconState.hashTreeRoot - 1 full validator 138.70 us/op 195.90 us/op 0.71
BeaconState.hashTreeRoot - 32 full validator 1.4486 ms/op 1.7811 ms/op 0.81
BeaconState.hashTreeRoot - 512 full validator 14.338 ms/op 20.671 ms/op 0.69
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 162.30 us/op 219.08 us/op 0.74
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.0279 ms/op 2.9085 ms/op 0.70
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 27.267 ms/op 36.925 ms/op 0.74
BeaconState.hashTreeRoot - 1 balances 138.43 us/op 133.42 us/op 1.04
BeaconState.hashTreeRoot - 32 balances 1.4028 ms/op 1.2558 ms/op 1.12
BeaconState.hashTreeRoot - 512 balances 11.660 ms/op 12.913 ms/op 0.90
BeaconState.hashTreeRoot - 250000 balances 216.00 ms/op 211.77 ms/op 1.02
aggregationBits - 2048 els - zipIndexesInBitList 17.630 us/op 30.233 us/op 0.58
byteArrayEquals 32 84.697 ns/op 52.701 ns/op 1.61
Buffer.compare 32 62.975 ns/op 57.422 ns/op 1.10
byteArrayEquals 1024 2.2992 us/op 1.5818 us/op 1.45
Buffer.compare 1024 78.433 ns/op 74.074 ns/op 1.06
byteArrayEquals 16384 37.000 us/op 25.237 us/op 1.47
Buffer.compare 16384 306.35 ns/op 278.30 ns/op 1.10
byteArrayEquals 123687377 290.77 ms/op 186.96 ms/op 1.56
Buffer.compare 123687377 6.8426 ms/op 8.2472 ms/op 0.83
byteArrayEquals 32 - diff last byte 95.835 ns/op 55.014 ns/op 1.74
Buffer.compare 32 - diff last byte 72.723 ns/op 59.007 ns/op 1.23
byteArrayEquals 1024 - diff last byte 2.5621 us/op 1.5297 us/op 1.67
Buffer.compare 1024 - diff last byte 88.129 ns/op 74.729 ns/op 1.18
byteArrayEquals 16384 - diff last byte 61.894 us/op 24.443 us/op 2.53
Buffer.compare 16384 - diff last byte 424.23 ns/op 288.72 ns/op 1.47
byteArrayEquals 123687377 - diff last byte 447.82 ms/op 177.48 ms/op 2.52
Buffer.compare 123687377 - diff last byte 10.197 ms/op 6.5142 ms/op 1.57
byteArrayEquals 32 - random bytes 12.257 ns/op 5.9310 ns/op 2.07
Buffer.compare 32 - random bytes 139.01 ns/op 60.077 ns/op 2.31
byteArrayEquals 1024 - random bytes 11.349 ns/op 5.7540 ns/op 1.97
Buffer.compare 1024 - random bytes 142.63 ns/op 59.442 ns/op 2.40
byteArrayEquals 16384 - random bytes 12.748 ns/op 5.7410 ns/op 2.22
Buffer.compare 16384 - random bytes 152.21 ns/op 59.401 ns/op 2.56
byteArrayEquals 123687377 - random bytes 21.210 ns/op 8.8000 ns/op 2.41
Buffer.compare 123687377 - random bytes 188.84 ns/op 62.910 ns/op 3.00
regular array get 100000 times 129.81 us/op 31.883 us/op 4.07
wrappedArray get 100000 times 116.05 us/op 32.058 us/op 3.62
arrayWithProxy get 100000 times 48.117 ms/op 14.860 ms/op 3.24
ssz.Root.equals 101.17 ns/op 49.097 ns/op 2.06
byteArrayEquals 113.99 ns/op 48.428 ns/op 2.35
Buffer.compare 35.303 ns/op 10.711 ns/op 3.30
shuffle list - 16384 els 15.313 ms/op 6.8414 ms/op 2.24
shuffle list - 250000 els 199.22 ms/op 100.34 ms/op 1.99
processSlot - 1 slots 40.363 us/op 17.301 us/op 2.33
processSlot - 32 slots 7.8360 ms/op 3.5902 ms/op 2.18
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 108.30 ms/op 59.881 ms/op 1.81
getCommitteeAssignments - req 1 vs - 250000 vc 4.1981 ms/op 2.5055 ms/op 1.68
getCommitteeAssignments - req 100 vs - 250000 vc 8.6258 ms/op 3.7558 ms/op 2.30
getCommitteeAssignments - req 1000 vs - 250000 vc 9.6929 ms/op 4.1053 ms/op 2.36
findModifiedValidators - 10000 modified validators 949.21 ms/op 586.42 ms/op 1.62
findModifiedValidators - 1000 modified validators 928.23 ms/op 511.49 ms/op 1.81
findModifiedValidators - 100 modified validators 963.45 ms/op 477.08 ms/op 2.02
findModifiedValidators - 10 modified validators 778.44 ms/op 473.29 ms/op 1.64
findModifiedValidators - 1 modified validators 1.1625 s/op 423.43 ms/op 2.75
findModifiedValidators - no difference 1.2676 s/op 451.32 ms/op 2.81
compare ViewDUs 8.2511 s/op 4.4099 s/op 1.87
compare each validator Uint8Array 2.9104 s/op 1.7986 s/op 1.62
compare ViewDU to Uint8Array 2.2447 s/op 1.1069 s/op 2.03
migrate state 1000000 validators, 24 modified, 0 new 1.7390 s/op 767.83 ms/op 2.26
migrate state 1000000 validators, 1700 modified, 1000 new 2.7734 s/op 1.0499 s/op 2.64
migrate state 1000000 validators, 3400 modified, 2000 new 3.7080 s/op 1.3753 s/op 2.70
migrate state 1500000 validators, 24 modified, 0 new 1.9818 s/op 854.84 ms/op 2.32
migrate state 1500000 validators, 1700 modified, 1000 new 2.7795 s/op 1.1990 s/op 2.32
migrate state 1500000 validators, 3400 modified, 2000 new 3.2698 s/op 1.5308 s/op 2.14
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 13.700 ns/op 5.0100 ns/op 2.73
state getBlockRootAtSlot - 250000 vs - 7PWei 1.1349 us/op 722.66 ns/op 1.57
computeProposers - vc 250000 33.718 ms/op 10.142 ms/op 3.32
computeEpochShuffling - vc 250000 375.48 ms/op 113.11 ms/op 3.32
getNextSyncCommittee - vc 250000 269.68 ms/op 178.18 ms/op 1.51
computeSigningRoot for AttestationData 59.037 us/op 31.126 us/op 1.90
hash AttestationData serialized data then Buffer.toString(base64) 4.3954 us/op 2.4545 us/op 1.79
toHexString serialized data 1.4373 us/op 1.3855 us/op 1.04
Buffer.toString(base64) 278.94 ns/op 268.47 ns/op 1.04

Please sign in to comment.