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

feat: use snappy-wasm #6483

Open
wants to merge 15 commits into
base: unstable
Choose a base branch
from
Open

feat: use snappy-wasm #6483

wants to merge 15 commits into from

Conversation

wemeetagain
Copy link
Member

@wemeetagain wemeetagain commented Feb 26, 2024

Motivation

Benchmarks show snappy-wasm is faster at compressing and uncompressing than snappyjs.

Description

  • Use snappy-wasm for compressing / uncompressing gossip payloads
  • Add more snappy vs snappyjs vs snappy-wasm benchmarks

TODO

  • deploy this branch on our test fleet - deployed on feat3
  network / gossip / snappy
    compress
      ✔ 100 bytes - compress - snappyjs                                     335566.9 ops/s    2.980032 us/op        -        685 runs   2.54 s
      ✔ 100 bytes - compress - snappy                                       388610.3 ops/s    2.573272 us/op        -        870 runs   2.74 s
      ✔ 100 bytes - compress - snappy-wasm                                  583254.0 ops/s    1.714519 us/op        -        476 runs   1.32 s
      ✔ 100 bytes - compress - snappy-wasm - prealloc                        1586695 ops/s    630.2410 ns/op        -        481 runs  0.804 s
      ✔ 200 bytes - compress - snappyjs                                     298272.8 ops/s    3.352636 us/op        -        213 runs   1.22 s
      ✔ 200 bytes - compress - snappy                                       419528.0 ops/s    2.383631 us/op        -        926 runs   2.71 s
      ✔ 200 bytes - compress - snappy-wasm                                  472468.5 ops/s    2.116543 us/op        -        577 runs   1.72 s
      ✔ 200 bytes - compress - snappy-wasm - prealloc                        1430445 ops/s    699.0830 ns/op        -        868 runs   1.11 s
      ✔ 300 bytes - compress - snappyjs                                     265124.9 ops/s    3.771807 us/op        -        137 runs   1.02 s
      ✔ 300 bytes - compress - snappy                                       361683.9 ops/s    2.764845 us/op        -       1332 runs   4.18 s
      ✔ 300 bytes - compress - snappy-wasm                                  443688.4 ops/s    2.253834 us/op        -        859 runs   2.44 s
      ✔ 300 bytes - compress - snappy-wasm - prealloc                        1213825 ops/s    823.8420 ns/op        -        370 runs  0.807 s
      ✔ 400 bytes - compress - snappyjs                                     262168.5 ops/s    3.814341 us/op        -        358 runs   1.87 s
      ✔ 400 bytes - compress - snappy                                       382494.9 ops/s    2.614414 us/op        -       1562 runs   4.58 s
      ✔ 400 bytes - compress - snappy-wasm                                  406373.2 ops/s    2.460792 us/op        -        797 runs   2.46 s
      ✔ 400 bytes - compress - snappy-wasm - prealloc                        1111715 ops/s    899.5110 ns/op        -        450 runs  0.906 s
      ✔ 500 bytes - compress - snappyjs                                     229213.1 ops/s    4.362753 us/op        -        359 runs   2.07 s
      ✔ 500 bytes - compress - snappy                                       373695.8 ops/s    2.675973 us/op        -       2050 runs   5.99 s
      ✔ 500 bytes - compress - snappy-wasm                                  714917.4 ops/s    1.398763 us/op        -        960 runs   1.84 s
      ✔ 500 bytes - compress - snappy-wasm - prealloc                        1054619 ops/s    948.2100 ns/op        -        427 runs  0.907 s
      ✔ 1000 bytes - compress - snappyjs                                    148702.3 ops/s    6.724847 us/op        -        171 runs   1.65 s
      ✔ 1000 bytes - compress - snappy                                      423688.1 ops/s    2.360227 us/op        -        525 runs   1.74 s
      ✔ 1000 bytes - compress - snappy-wasm                                 524350.6 ops/s    1.907121 us/op        -        273 runs   1.03 s
      ✔ 1000 bytes - compress - snappy-wasm - prealloc                      685191.5 ops/s    1.459446 us/op        -        349 runs   1.01 s
      ✔ 10000 bytes - compress - snappyjs                                   21716.92 ops/s    46.04704 us/op        -         16 runs   1.24 s
      ✔ 10000 bytes - compress - snappy                                     98051.32 ops/s    10.19874 us/op        -        184 runs   2.39 s
      ✔ 10000 bytes - compress - snappy-wasm                                114681.8 ops/s    8.719783 us/op        -         49 runs  0.937 s
      ✔ 10000 bytes - compress - snappy-wasm - prealloc                     111203.6 ops/s    8.992518 us/op        -         49 runs  0.953 s
      ✔ 100000 bytes - compress - snappyjs                                  2947.313 ops/s    339.2921 us/op        -         12 runs   4.74 s
      ✔ 100000 bytes - compress - snappy                                    14963.78 ops/s    66.82801 us/op        -         70 runs   5.19 s
      ✔ 100000 bytes - compress - snappy-wasm                               19868.33 ops/s    50.33136 us/op        -         14 runs   1.21 s
      ✔ 100000 bytes - compress - snappy-wasm - prealloc                    24579.34 ops/s    40.68457 us/op        -         13 runs   1.06 s
    uncompress
      ✔ 100 bytes - uncompress - snappyjs                                   589201.6 ops/s    1.697212 us/op        -        242 runs  0.911 s
      ✔ 100 bytes - uncompress - snappy                                     537424.1 ops/s    1.860728 us/op        -        220 runs  0.910 s
      ✔ 100 bytes - uncompress - snappy-wasm                                634966.2 ops/s    1.574887 us/op        -        194 runs  0.808 s
      ✔ 100 bytes - uncompress - snappy-wasm - prealloc                      1846964 ops/s    541.4290 ns/op        -        559 runs  0.804 s
      ✔ 200 bytes - uncompress - snappyjs                                   395141.8 ops/s    2.530737 us/op        -        281 runs   1.22 s
      ✔ 200 bytes - uncompress - snappy                                     536862.6 ops/s    1.862674 us/op        -        274 runs   1.01 s
      ✔ 200 bytes - uncompress - snappy-wasm                                420251.6 ops/s    2.379527 us/op        -        129 runs  0.810 s
      ✔ 200 bytes - uncompress - snappy-wasm - prealloc                      1746167 ops/s    572.6830 ns/op        -        529 runs  0.804 s
      ✔ 300 bytes - uncompress - snappyjs                                   441676.2 ops/s    2.264102 us/op        -        898 runs   2.53 s
      ✔ 300 bytes - uncompress - snappy                                     551313.2 ops/s    1.813851 us/op        -        336 runs   1.11 s
      ✔ 300 bytes - uncompress - snappy-wasm                                494773.0 ops/s    2.021129 us/op        -        203 runs  0.912 s
      ✔ 300 bytes - uncompress - snappy-wasm - prealloc                      1528680 ops/s    654.1590 ns/op        -        465 runs  0.805 s
      ✔ 400 bytes - uncompress - snappyjs                                   383746.1 ops/s    2.605890 us/op        -        235 runs   1.11 s
      ✔ 400 bytes - uncompress - snappy                                     515986.6 ops/s    1.938035 us/op        -        158 runs  0.809 s
      ✔ 400 bytes - uncompress - snappy-wasm                                392947.8 ops/s    2.544867 us/op        -        322 runs   1.32 s
      ✔ 400 bytes - uncompress - snappy-wasm - prealloc                      1425978 ops/s    701.2730 ns/op        -        721 runs   1.01 s
      ✔ 500 bytes - uncompress - snappyjs                                   330727.5 ops/s    3.023637 us/op        -        173 runs   1.02 s
      ✔ 500 bytes - uncompress - snappy                                     513874.1 ops/s    1.946002 us/op        -        157 runs  0.806 s
      ✔ 500 bytes - uncompress - snappy-wasm                                389263.0 ops/s    2.568957 us/op        -        161 runs  0.914 s
      ✔ 500 bytes - uncompress - snappy-wasm - prealloc                      1330936 ops/s    751.3510 ns/op        -        672 runs   1.01 s
      ✔ 1000 bytes - uncompress - snappyjs                                  241393.9 ops/s    4.142606 us/op        -        126 runs   1.03 s
      ✔ 1000 bytes - uncompress - snappy                                    491119.6 ops/s    2.036164 us/op        -        201 runs  0.911 s
      ✔ 1000 bytes - uncompress - snappy-wasm                               361794.5 ops/s    2.764000 us/op        -        148 runs  0.910 s
      ✔ 1000 bytes - uncompress - snappy-wasm - prealloc                    959026.5 ops/s    1.042724 us/op        -        390 runs  0.909 s
      ✔ 10000 bytes - uncompress - snappyjs                                 40519.03 ops/s    24.67976 us/op        -         16 runs  0.913 s
      ✔ 10000 bytes - uncompress - snappy                                   202537.6 ops/s    4.937355 us/op        -        796 runs   4.43 s
      ✔ 10000 bytes - uncompress - snappy-wasm                              165017.6 ops/s    6.059960 us/op        -         52 runs  0.822 s
      ✔ 10000 bytes - uncompress - snappy-wasm - prealloc                   175061.5 ops/s    5.712277 us/op        -        130 runs   1.25 s
      ✔ 100000 bytes - uncompress - snappyjs                                4030.391 ops/s    248.1149 us/op        -         12 runs   3.71 s
      ✔ 100000 bytes - uncompress - snappy                                  35459.43 ops/s    28.20124 us/op        -         41 runs   1.67 s
      ✔ 100000 bytes - uncompress - snappy-wasm                             22449.16 ops/s    44.54509 us/op        -         13 runs   1.11 s
      ✔ 100000 bytes - uncompress - snappy-wasm - prealloc                  27169.50 ops/s    36.80598 us/op        -         13 runs  0.997 s

Closes #4170

Benchmarks show `snappy` is faster at compressing and uncompressing
larger payloads than `snappyjs`.
@wemeetagain wemeetagain requested a review from a team as a code owner February 26, 2024 17:29
Copy link
Contributor

github-actions bot commented Feb 26, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: a8f750e Previous: 376fe2a Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.9979 ms/op 2.0036 ms/op 1.00
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 47.211 us/op 55.563 us/op 0.85
BLS verify - blst 854.53 us/op 854.17 us/op 1.00
BLS verifyMultipleSignatures 3 - blst 1.3203 ms/op 1.2306 ms/op 1.07
BLS verifyMultipleSignatures 8 - blst 2.0004 ms/op 2.4095 ms/op 0.83
BLS verifyMultipleSignatures 32 - blst 5.0749 ms/op 5.4081 ms/op 0.94
BLS verifyMultipleSignatures 64 - blst 9.9702 ms/op 11.174 ms/op 0.89
BLS verifyMultipleSignatures 128 - blst 18.946 ms/op 17.843 ms/op 1.06
BLS deserializing 10000 signatures 704.77 ms/op 711.82 ms/op 0.99
BLS deserializing 100000 signatures 7.0483 s/op 7.1638 s/op 0.98
BLS verifyMultipleSignatures - same message - 3 - blst 919.19 us/op 1.0133 ms/op 0.91
BLS verifyMultipleSignatures - same message - 8 - blst 1.0842 ms/op 1.1963 ms/op 0.91
BLS verifyMultipleSignatures - same message - 32 - blst 1.7661 ms/op 2.0439 ms/op 0.86
BLS verifyMultipleSignatures - same message - 64 - blst 2.7088 ms/op 2.8111 ms/op 0.96
BLS verifyMultipleSignatures - same message - 128 - blst 4.4217 ms/op 4.8535 ms/op 0.91
BLS aggregatePubkeys 32 - blst 21.744 us/op 20.993 us/op 1.04
BLS aggregatePubkeys 128 - blst 78.481 us/op 71.862 us/op 1.09
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 50.935 ms/op 60.459 ms/op 0.84
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 47.929 ms/op 58.462 ms/op 0.82
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 50.579 ms/op 48.924 ms/op 1.03
getSlashingsAndExits - default max 100.95 us/op 142.75 us/op 0.71
getSlashingsAndExits - 2k 323.89 us/op 344.14 us/op 0.94
proposeBlockBody type=full, size=empty 6.7410 ms/op 7.0730 ms/op 0.95
isKnown best case - 1 super set check 379.00 ns/op 517.00 ns/op 0.73
isKnown normal case - 2 super set checks 429.00 ns/op 370.00 ns/op 1.16
isKnown worse case - 16 super set checks 472.00 ns/op 525.00 ns/op 0.90
InMemoryCheckpointStateCache - add get delete 3.2040 us/op 3.4400 us/op 0.93
validate api signedAggregateAndProof - struct 1.4979 ms/op 1.6002 ms/op 0.94
validate gossip signedAggregateAndProof - struct 1.5322 ms/op 1.5658 ms/op 0.98
batch validate gossip attestation - vc 640000 - chunk 32 139.73 us/op 141.16 us/op 0.99
batch validate gossip attestation - vc 640000 - chunk 64 129.59 us/op 126.82 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 128 117.92 us/op 122.61 us/op 0.96
batch validate gossip attestation - vc 640000 - chunk 256 115.91 us/op 118.81 us/op 0.98
pickEth1Vote - no votes 1.2192 ms/op 1.1761 ms/op 1.04
pickEth1Vote - max votes 7.4098 ms/op 7.0365 ms/op 1.05
pickEth1Vote - Eth1Data hashTreeRoot value x2048 16.748 ms/op 13.514 ms/op 1.24
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 21.864 ms/op 21.854 ms/op 1.00
pickEth1Vote - Eth1Data fastSerialize value x2048 598.47 us/op 579.47 us/op 1.03
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.9130 ms/op 3.1936 ms/op 1.54
bytes32 toHexString 619.00 ns/op 655.00 ns/op 0.95
bytes32 Buffer.toString(hex) 269.00 ns/op 286.00 ns/op 0.94
bytes32 Buffer.toString(hex) from Uint8Array 480.00 ns/op 466.00 ns/op 1.03
bytes32 Buffer.toString(hex) + 0x 265.00 ns/op 276.00 ns/op 0.96
Object access 1 prop 0.20200 ns/op 0.16600 ns/op 1.22
Map access 1 prop 0.14200 ns/op 0.15000 ns/op 0.95
Object get x1000 6.5060 ns/op 6.3060 ns/op 1.03
Map get x1000 6.7610 ns/op 6.7430 ns/op 1.00
Object set x1000 46.394 ns/op 42.152 ns/op 1.10
Map set x1000 37.626 ns/op 27.178 ns/op 1.38
Return object 10000 times 0.30540 ns/op 0.31110 ns/op 0.98
Throw Error 10000 times 3.5932 us/op 3.5294 us/op 1.02
toHex 172.71 ns/op 194.56 ns/op 0.89
Buffer.from 153.73 ns/op 177.32 ns/op 0.87
shared Buffer 102.97 ns/op 105.13 ns/op 0.98
fastMsgIdFn sha256 / 200 bytes 2.4500 us/op 2.4650 us/op 0.99
fastMsgIdFn h32 xxhash / 200 bytes 290.00 ns/op 314.00 ns/op 0.92
fastMsgIdFn h64 xxhash / 200 bytes 289.00 ns/op 284.00 ns/op 1.02
fastMsgIdFn sha256 / 1000 bytes 7.5850 us/op 7.8520 us/op 0.97
fastMsgIdFn h32 xxhash / 1000 bytes 424.00 ns/op 472.00 ns/op 0.90
fastMsgIdFn h64 xxhash / 1000 bytes 368.00 ns/op 375.00 ns/op 0.98
fastMsgIdFn sha256 / 10000 bytes 67.382 us/op 66.136 us/op 1.02
fastMsgIdFn h32 xxhash / 10000 bytes 1.9760 us/op 1.9960 us/op 0.99
fastMsgIdFn h64 xxhash / 10000 bytes 1.2740 us/op 1.2830 us/op 0.99
100 bytes - compress - snappyjs 1.5904 us/op
100 bytes - compress - snappy 1.5979 us/op
100 bytes - compress - snappy-wasm 1.0896 us/op
100 bytes - compress - snappy-wasm - prealloc 491.74 ns/op
200 bytes - compress - snappyjs 1.9027 us/op
200 bytes - compress - snappy 1.6219 us/op
200 bytes - compress - snappy-wasm 1.1210 us/op
200 bytes - compress - snappy-wasm - prealloc 477.19 ns/op
300 bytes - compress - snappyjs 2.3551 us/op
300 bytes - compress - snappy 1.7064 us/op
300 bytes - compress - snappy-wasm 1.6166 us/op
300 bytes - compress - snappy-wasm - prealloc 625.42 ns/op
400 bytes - compress - snappyjs 2.8529 us/op
400 bytes - compress - snappy 1.7322 us/op
400 bytes - compress - snappy-wasm 1.7463 us/op
400 bytes - compress - snappy-wasm - prealloc 724.98 ns/op
500 bytes - compress - snappyjs 3.3248 us/op
500 bytes - compress - snappy 2.0314 us/op
500 bytes - compress - snappy-wasm 1.4812 us/op
500 bytes - compress - snappy-wasm - prealloc 762.24 ns/op
1000 bytes - compress - snappyjs 4.6199 us/op
1000 bytes - compress - snappy 3.9580 us/op
1000 bytes - compress - snappy-wasm 1.7586 us/op
1000 bytes - compress - snappy-wasm - prealloc 1.0040 us/op
10000 bytes - compress - snappyjs 29.396 us/op
10000 bytes - compress - snappy 29.336 us/op
10000 bytes - compress - snappy-wasm 6.5150 us/op
10000 bytes - compress - snappy-wasm - prealloc 5.8529 us/op
100000 bytes - compress - snappyjs 198.63 us/op
100000 bytes - compress - snappy 104.69 us/op
100000 bytes - compress - snappy-wasm 38.075 us/op
100000 bytes - compress - snappy-wasm - prealloc 37.209 us/op
100 bytes - uncompress - snappyjs 967.00 ns/op
100 bytes - uncompress - snappy 1.5241 us/op
100 bytes - uncompress - snappy-wasm 898.85 ns/op
100 bytes - uncompress - snappy-wasm - prealloc 409.23 ns/op
200 bytes - uncompress - snappyjs 1.0744 us/op
200 bytes - uncompress - snappy 1.3521 us/op
200 bytes - uncompress - snappy-wasm 978.15 ns/op
200 bytes - uncompress - snappy-wasm - prealloc 392.69 ns/op
300 bytes - uncompress - snappyjs 1.1114 us/op
300 bytes - uncompress - snappy 1.5393 us/op
300 bytes - uncompress - snappy-wasm 1.3501 us/op
300 bytes - uncompress - snappy-wasm - prealloc 434.27 ns/op
400 bytes - uncompress - snappyjs 1.4350 us/op
400 bytes - uncompress - snappy 1.5586 us/op
400 bytes - uncompress - snappy-wasm 1.5001 us/op
400 bytes - uncompress - snappy-wasm - prealloc 472.21 ns/op
500 bytes - uncompress - snappyjs 1.6411 us/op
500 bytes - uncompress - snappy 1.6418 us/op
500 bytes - uncompress - snappy-wasm 1.4545 us/op
500 bytes - uncompress - snappy-wasm - prealloc 555.42 ns/op
1000 bytes - uncompress - snappyjs 2.1653 us/op
1000 bytes - uncompress - snappy 3.4187 us/op
1000 bytes - uncompress - snappy-wasm 1.4427 us/op
1000 bytes - uncompress - snappy-wasm - prealloc 777.11 ns/op
10000 bytes - uncompress - snappyjs 13.525 us/op
10000 bytes - uncompress - snappy 31.553 us/op
10000 bytes - uncompress - snappy-wasm 4.6113 us/op
10000 bytes - uncompress - snappy-wasm - prealloc 4.1624 us/op
100000 bytes - uncompress - snappyjs 134.65 us/op
100000 bytes - uncompress - snappy 112.19 us/op
100000 bytes - uncompress - snappy-wasm 39.474 us/op
100000 bytes - uncompress - snappy-wasm - prealloc 30.269 us/op
send data - 1000 256B messages 13.181 ms/op 13.993 ms/op 0.94
send data - 1000 512B messages 17.056 ms/op 18.736 ms/op 0.91
send data - 1000 1024B messages 26.711 ms/op 28.119 ms/op 0.95
send data - 1000 1200B messages 25.894 ms/op 27.409 ms/op 0.94
send data - 1000 2048B messages 30.700 ms/op 38.376 ms/op 0.80
send data - 1000 4096B messages 33.976 ms/op 36.168 ms/op 0.94
send data - 1000 16384B messages 72.626 ms/op 75.293 ms/op 0.96
send data - 1000 65536B messages 219.38 ms/op 257.41 ms/op 0.85
enrSubnets - fastDeserialize 64 bits 1.0780 us/op 1.8320 us/op 0.59
enrSubnets - ssz BitVector 64 bits 357.00 ns/op 493.00 ns/op 0.72
enrSubnets - fastDeserialize 4 bits 146.00 ns/op 217.00 ns/op 0.67
enrSubnets - ssz BitVector 4 bits 388.00 ns/op 474.00 ns/op 0.82
prioritizePeers score -10:0 att 32-0.1 sync 2-0 151.07 us/op 197.58 us/op 0.76
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 156.09 us/op 192.26 us/op 0.81
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 279.78 us/op 314.98 us/op 0.89
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 429.24 us/op 417.18 us/op 1.03
prioritizePeers score 0:0 att 64-1 sync 4-1 722.71 us/op 782.82 us/op 0.92
array of 16000 items push then shift 1.6437 us/op 1.6974 us/op 0.97
LinkedList of 16000 items push then shift 7.2450 ns/op 8.1620 ns/op 0.89
array of 16000 items push then pop 99.102 ns/op 140.63 ns/op 0.70
LinkedList of 16000 items push then pop 6.9710 ns/op 7.8470 ns/op 0.89
array of 24000 items push then shift 2.4370 us/op 2.7280 us/op 0.89
LinkedList of 24000 items push then shift 7.0730 ns/op 8.5850 ns/op 0.82
array of 24000 items push then pop 141.03 ns/op 181.72 ns/op 0.78
LinkedList of 24000 items push then pop 6.8730 ns/op 7.7670 ns/op 0.88
intersect bitArray bitLen 8 6.3470 ns/op 6.6790 ns/op 0.95
intersect array and set length 8 45.546 ns/op 55.853 ns/op 0.82
intersect bitArray bitLen 128 29.962 ns/op 30.580 ns/op 0.98
intersect array and set length 128 661.41 ns/op 793.62 ns/op 0.83
bitArray.getTrueBitIndexes() bitLen 128 1.9950 us/op 1.7740 us/op 1.12
bitArray.getTrueBitIndexes() bitLen 248 3.1900 us/op 3.5960 us/op 0.89
bitArray.getTrueBitIndexes() bitLen 512 5.8770 us/op 6.7500 us/op 0.87
Buffer.concat 32 items 852.00 ns/op 937.00 ns/op 0.91
Uint8Array.set 32 items 1.4260 us/op 1.4030 us/op 1.02
Buffer.copy 1.6900 us/op 1.5500 us/op 1.09
Uint8Array.set - with subarray 2.4770 us/op 2.5880 us/op 0.96
Uint8Array.set - without subarray 1.4430 us/op 1.4480 us/op 1.00
getUint32 - dataview 235.00 ns/op 266.00 ns/op 0.88
getUint32 - manual 156.00 ns/op 207.00 ns/op 0.75
Set add up to 64 items then delete first 2.1938 us/op 2.8095 us/op 0.78
OrderedSet add up to 64 items then delete first 3.3449 us/op 3.7947 us/op 0.88
Set add up to 64 items then delete last 2.5722 us/op 3.1588 us/op 0.81
OrderedSet add up to 64 items then delete last 3.7128 us/op 4.9976 us/op 0.74
Set add up to 64 items then delete middle 2.5048 us/op 3.0351 us/op 0.83
OrderedSet add up to 64 items then delete middle 5.4497 us/op 6.7411 us/op 0.81
Set add up to 128 items then delete first 5.2513 us/op 6.1272 us/op 0.86
OrderedSet add up to 128 items then delete first 8.1486 us/op 9.8838 us/op 0.82
Set add up to 128 items then delete last 5.0570 us/op 6.0127 us/op 0.84
OrderedSet add up to 128 items then delete last 7.3201 us/op 8.2466 us/op 0.89
Set add up to 128 items then delete middle 4.8775 us/op 5.1914 us/op 0.94
OrderedSet add up to 128 items then delete middle 13.720 us/op 13.981 us/op 0.98
Set add up to 256 items then delete first 10.948 us/op 11.185 us/op 0.98
OrderedSet add up to 256 items then delete first 16.567 us/op 17.158 us/op 0.97
Set add up to 256 items then delete last 9.7141 us/op 10.537 us/op 0.92
OrderedSet add up to 256 items then delete last 14.561 us/op 16.201 us/op 0.90
Set add up to 256 items then delete middle 9.7690 us/op 10.126 us/op 0.96
OrderedSet add up to 256 items then delete middle 41.176 us/op 45.227 us/op 0.91
transfer serialized Status (84 B) 1.3810 us/op 1.4730 us/op 0.94
copy serialized Status (84 B) 1.1040 us/op 1.2630 us/op 0.87
transfer serialized SignedVoluntaryExit (112 B) 1.4690 us/op 1.6400 us/op 0.90
copy serialized SignedVoluntaryExit (112 B) 1.1520 us/op 1.3130 us/op 0.88
transfer serialized ProposerSlashing (416 B) 2.1710 us/op 1.8870 us/op 1.15
copy serialized ProposerSlashing (416 B) 2.3210 us/op 1.8390 us/op 1.26
transfer serialized Attestation (485 B) 2.3010 us/op 2.2150 us/op 1.04
copy serialized Attestation (485 B) 2.3300 us/op 1.9770 us/op 1.18
transfer serialized AttesterSlashing (33232 B) 2.5220 us/op 1.8680 us/op 1.35
copy serialized AttesterSlashing (33232 B) 5.9360 us/op 5.6550 us/op 1.05
transfer serialized Small SignedBeaconBlock (128000 B) 3.5020 us/op 3.1020 us/op 1.13
copy serialized Small SignedBeaconBlock (128000 B) 16.780 us/op 17.401 us/op 0.96
transfer serialized Avg SignedBeaconBlock (200000 B) 3.9910 us/op 3.4150 us/op 1.17
copy serialized Avg SignedBeaconBlock (200000 B) 23.657 us/op 23.374 us/op 1.01
transfer serialized BlobsSidecar (524380 B) 3.7170 us/op 2.6320 us/op 1.41
copy serialized BlobsSidecar (524380 B) 152.33 us/op 87.817 us/op 1.73
transfer serialized Big SignedBeaconBlock (1000000 B) 3.6810 us/op 2.6820 us/op 1.37
copy serialized Big SignedBeaconBlock (1000000 B) 152.70 us/op 260.27 us/op 0.59
pass gossip attestations to forkchoice per slot 2.7801 ms/op 2.9338 ms/op 0.95
forkChoice updateHead vc 100000 bc 64 eq 0 461.13 us/op 464.74 us/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 0 2.7450 ms/op 3.0192 ms/op 0.91
forkChoice updateHead vc 1000000 bc 64 eq 0 4.8284 ms/op 5.6323 ms/op 0.86
forkChoice updateHead vc 600000 bc 320 eq 0 2.7376 ms/op 2.9160 ms/op 0.94
forkChoice updateHead vc 600000 bc 1200 eq 0 2.7752 ms/op 3.1580 ms/op 0.88
forkChoice updateHead vc 600000 bc 7200 eq 0 3.6096 ms/op 4.9366 ms/op 0.73
forkChoice updateHead vc 600000 bc 64 eq 1000 10.279 ms/op 10.577 ms/op 0.97
forkChoice updateHead vc 600000 bc 64 eq 10000 10.316 ms/op 10.937 ms/op 0.94
forkChoice updateHead vc 600000 bc 64 eq 300000 14.665 ms/op 23.981 ms/op 0.61
computeDeltas 500000 validators 300 proto nodes 3.8574 ms/op 4.9631 ms/op 0.78
computeDeltas 500000 validators 1200 proto nodes 3.8509 ms/op 6.3960 ms/op 0.60
computeDeltas 500000 validators 7200 proto nodes 3.9394 ms/op 7.2611 ms/op 0.54
computeDeltas 750000 validators 300 proto nodes 6.1186 ms/op 8.9259 ms/op 0.69
computeDeltas 750000 validators 1200 proto nodes 6.0057 ms/op 9.6137 ms/op 0.62
computeDeltas 750000 validators 7200 proto nodes 6.0797 ms/op 11.343 ms/op 0.54
computeDeltas 1400000 validators 300 proto nodes 11.364 ms/op 20.141 ms/op 0.56
computeDeltas 1400000 validators 1200 proto nodes 12.432 ms/op 13.797 ms/op 0.90
computeDeltas 1400000 validators 7200 proto nodes 15.887 ms/op 14.282 ms/op 1.11
computeDeltas 2100000 validators 300 proto nodes 22.180 ms/op 18.750 ms/op 1.18
computeDeltas 2100000 validators 1200 proto nodes 30.392 ms/op 19.185 ms/op 1.58
computeDeltas 2100000 validators 7200 proto nodes 21.375 ms/op 18.635 ms/op 1.15
altair processAttestation - 250000 vs - 7PWei normalcase 3.0700 ms/op 2.2598 ms/op 1.36
altair processAttestation - 250000 vs - 7PWei worstcase 4.2525 ms/op 3.0509 ms/op 1.39
altair processAttestation - setStatus - 1/6 committees join 125.26 us/op 130.84 us/op 0.96
altair processAttestation - setStatus - 1/3 committees join 225.70 us/op 246.70 us/op 0.91
altair processAttestation - setStatus - 1/2 committees join 304.43 us/op 354.08 us/op 0.86
altair processAttestation - setStatus - 2/3 committees join 366.73 us/op 427.36 us/op 0.86
altair processAttestation - setStatus - 4/5 committees join 649.03 us/op 600.92 us/op 1.08
altair processAttestation - setStatus - 100% committees join 818.56 us/op 727.74 us/op 1.12
altair processBlock - 250000 vs - 7PWei normalcase 7.0234 ms/op 4.9710 ms/op 1.41
altair processBlock - 250000 vs - 7PWei normalcase hashState 44.456 ms/op 29.204 ms/op 1.52
altair processBlock - 250000 vs - 7PWei worstcase 43.198 ms/op 33.150 ms/op 1.30
altair processBlock - 250000 vs - 7PWei worstcase hashState 87.350 ms/op 67.777 ms/op 1.29
phase0 processBlock - 250000 vs - 7PWei normalcase 2.8128 ms/op 1.9383 ms/op 1.45
phase0 processBlock - 250000 vs - 7PWei worstcase 26.037 ms/op 21.952 ms/op 1.19
altair processEth1Data - 250000 vs - 7PWei normalcase 568.19 us/op 315.69 us/op 1.80
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 7.4690 us/op 6.1260 us/op 1.22
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 49.433 us/op 38.384 us/op 1.29
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 13.146 us/op 10.374 us/op 1.27
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 6.7180 us/op 6.1060 us/op 1.10
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 159.17 us/op 144.45 us/op 1.10
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.1855 ms/op 1.2450 ms/op 0.95
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.5540 ms/op 1.7409 ms/op 0.89
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.5710 ms/op 1.6723 ms/op 0.94
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.4822 ms/op 3.9279 ms/op 1.14
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.6181 ms/op 1.6877 ms/op 0.96
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 6.6059 ms/op 3.9247 ms/op 1.68
Tree 40 250000 create 678.75 ms/op 228.22 ms/op 2.97
Tree 40 250000 get(125000) 175.77 ns/op 148.73 ns/op 1.18
Tree 40 250000 set(125000) 1.8012 us/op 738.81 ns/op 2.44
Tree 40 250000 toArray() 29.551 ms/op 21.105 ms/op 1.40
Tree 40 250000 iterate all - toArray() + loop 29.740 ms/op 22.285 ms/op 1.33
Tree 40 250000 iterate all - get(i) 62.710 ms/op 61.278 ms/op 1.02
Array 250000 create 4.6827 ms/op 3.8996 ms/op 1.20
Array 250000 clone - spread 1.6365 ms/op 1.5898 ms/op 1.03
Array 250000 get(125000) 0.46100 ns/op 0.44100 ns/op 1.05
Array 250000 set(125000) 0.48300 ns/op 0.46700 ns/op 1.03
Array 250000 iterate all - loop 107.76 us/op 114.37 us/op 0.94
phase0 afterProcessEpoch - 250000 vs - 7PWei 55.651 ms/op 55.409 ms/op 1.00
Array.fill - length 1000000 4.6286 ms/op 3.9690 ms/op 1.17
Array push - length 1000000 26.114 ms/op 17.666 ms/op 1.48
Array.get 0.29589 ns/op 0.32505 ns/op 0.91
Uint8Array.get 0.47126 ns/op 0.51825 ns/op 0.91
phase0 beforeProcessEpoch - 250000 vs - 7PWei 59.290 ms/op 20.753 ms/op 2.86
altair processEpoch - mainnet_e81889 573.07 ms/op 304.35 ms/op 1.88
mainnet_e81889 - altair beforeProcessEpoch 48.550 ms/op 19.464 ms/op 2.49
mainnet_e81889 - altair processJustificationAndFinalization 44.820 us/op 12.792 us/op 3.50
mainnet_e81889 - altair processInactivityUpdates 14.840 ms/op 6.7248 ms/op 2.21
mainnet_e81889 - altair processRewardsAndPenalties 81.830 ms/op 38.636 ms/op 2.12
mainnet_e81889 - altair processRegistryUpdates 7.6970 us/op 2.1040 us/op 3.66
mainnet_e81889 - altair processSlashings 1.4900 us/op 414.00 ns/op 3.60
mainnet_e81889 - altair processEth1DataReset 778.00 ns/op 298.00 ns/op 2.61
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.7564 ms/op 1.9385 ms/op 0.91
mainnet_e81889 - altair processSlashingsReset 6.5330 us/op 2.8360 us/op 2.30
mainnet_e81889 - altair processRandaoMixesReset 10.330 us/op 5.8170 us/op 1.78
mainnet_e81889 - altair processHistoricalRootsUpdate 2.2890 us/op 414.00 ns/op 5.53
mainnet_e81889 - altair processParticipationFlagUpdates 6.3770 us/op 1.8040 us/op 3.53
mainnet_e81889 - altair processSyncCommitteeUpdates 1.2480 us/op 327.00 ns/op 3.82
mainnet_e81889 - altair afterProcessEpoch 55.699 ms/op 52.891 ms/op 1.05
capella processEpoch - mainnet_e217614 1.2050 s/op 1.1158 s/op 1.08
mainnet_e217614 - capella beforeProcessEpoch 88.293 ms/op 80.594 ms/op 1.10
mainnet_e217614 - capella processJustificationAndFinalization 16.403 us/op 17.512 us/op 0.94
mainnet_e217614 - capella processInactivityUpdates 25.094 ms/op 19.131 ms/op 1.31
mainnet_e217614 - capella processRewardsAndPenalties 337.17 ms/op 225.18 ms/op 1.50
mainnet_e217614 - capella processRegistryUpdates 26.566 us/op 21.050 us/op 1.26
mainnet_e217614 - capella processSlashings 822.00 ns/op 603.00 ns/op 1.36
mainnet_e217614 - capella processEth1DataReset 940.00 ns/op 540.00 ns/op 1.74
mainnet_e217614 - capella processEffectiveBalanceUpdates 24.493 ms/op 6.6887 ms/op 3.66
mainnet_e217614 - capella processSlashingsReset 6.8030 us/op 6.0410 us/op 1.13
mainnet_e217614 - capella processRandaoMixesReset 8.7270 us/op 7.8070 us/op 1.12
mainnet_e217614 - capella processHistoricalRootsUpdate 2.0290 us/op 1.4450 us/op 1.40
mainnet_e217614 - capella processParticipationFlagUpdates 2.5550 us/op 3.1900 us/op 0.80
mainnet_e217614 - capella afterProcessEpoch 127.47 ms/op 136.66 ms/op 0.93
phase0 processEpoch - mainnet_e58758 355.16 ms/op 370.63 ms/op 0.96
mainnet_e58758 - phase0 beforeProcessEpoch 122.25 ms/op 90.513 ms/op 1.35
mainnet_e58758 - phase0 processJustificationAndFinalization 16.945 us/op 24.079 us/op 0.70
mainnet_e58758 - phase0 processRewardsAndPenalties 29.306 ms/op 44.983 ms/op 0.65
mainnet_e58758 - phase0 processRegistryUpdates 15.759 us/op 10.961 us/op 1.44
mainnet_e58758 - phase0 processSlashings 805.00 ns/op 481.00 ns/op 1.67
mainnet_e58758 - phase0 processEth1DataReset 608.00 ns/op 611.00 ns/op 1.00
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.2471 ms/op 4.2354 ms/op 0.29
mainnet_e58758 - phase0 processSlashingsReset 4.3380 us/op 4.3100 us/op 1.01
mainnet_e58758 - phase0 processRandaoMixesReset 4.7450 us/op 8.4270 us/op 0.56
mainnet_e58758 - phase0 processHistoricalRootsUpdate 497.00 ns/op 663.00 ns/op 0.75
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.4600 us/op 4.4750 us/op 0.77
mainnet_e58758 - phase0 afterProcessEpoch 44.034 ms/op 51.096 ms/op 0.86
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.8747 ms/op 1.9334 ms/op 0.97
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.3279 ms/op 2.8570 ms/op 0.81
altair processInactivityUpdates - 250000 normalcase 19.353 ms/op 19.131 ms/op 1.01
altair processInactivityUpdates - 250000 worstcase 17.690 ms/op 19.195 ms/op 0.92
phase0 processRegistryUpdates - 250000 normalcase 8.0240 us/op 9.4860 us/op 0.85
phase0 processRegistryUpdates - 250000 badcase_full_deposits 240.45 us/op 407.35 us/op 0.59
phase0 processRegistryUpdates - 250000 worstcase 0.5 112.77 ms/op 161.61 ms/op 0.70
altair processRewardsAndPenalties - 250000 normalcase 34.848 ms/op 40.341 ms/op 0.86
altair processRewardsAndPenalties - 250000 worstcase 35.904 ms/op 41.266 ms/op 0.87
phase0 getAttestationDeltas - 250000 normalcase 7.6454 ms/op 8.8451 ms/op 0.86
phase0 getAttestationDeltas - 250000 worstcase 7.4895 ms/op 9.5070 ms/op 0.79
phase0 processSlashings - 250000 worstcase 76.220 us/op 110.93 us/op 0.69
altair processSyncCommitteeUpdates - 250000 124.14 ms/op 141.94 ms/op 0.87
BeaconState.hashTreeRoot - No change 223.00 ns/op 239.00 ns/op 0.93
BeaconState.hashTreeRoot - 1 full validator 141.76 us/op 108.38 us/op 1.31
BeaconState.hashTreeRoot - 32 full validator 1.5677 ms/op 1.2840 ms/op 1.22
BeaconState.hashTreeRoot - 512 full validator 11.123 ms/op 12.631 ms/op 0.88
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 146.03 us/op 153.67 us/op 0.95
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.8412 ms/op 1.9996 ms/op 0.92
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 25.017 ms/op 27.112 ms/op 0.92
BeaconState.hashTreeRoot - 1 balances 110.13 us/op 115.20 us/op 0.96
BeaconState.hashTreeRoot - 32 balances 1.0219 ms/op 1.2489 ms/op 0.82
BeaconState.hashTreeRoot - 512 balances 7.5988 ms/op 9.3482 ms/op 0.81
BeaconState.hashTreeRoot - 250000 balances 136.26 ms/op 180.76 ms/op 0.75
aggregationBits - 2048 els - zipIndexesInBitList 24.878 us/op 37.532 us/op 0.66
byteArrayEquals 32 55.536 ns/op 57.977 ns/op 0.96
Buffer.compare 32 17.682 ns/op 19.371 ns/op 0.91
byteArrayEquals 1024 1.6189 us/op 1.7187 us/op 0.94
Buffer.compare 1024 26.524 ns/op 26.872 ns/op 0.99
byteArrayEquals 16384 25.755 us/op 27.505 us/op 0.94
Buffer.compare 16384 191.28 ns/op 227.17 ns/op 0.84
byteArrayEquals 123687377 192.79 ms/op 217.92 ms/op 0.88
Buffer.compare 123687377 6.4928 ms/op 9.8755 ms/op 0.66
byteArrayEquals 32 - diff last byte 51.981 ns/op 59.850 ns/op 0.87
Buffer.compare 32 - diff last byte 16.827 ns/op 20.116 ns/op 0.84
byteArrayEquals 1024 - diff last byte 1.5639 us/op 1.7019 us/op 0.92
Buffer.compare 1024 - diff last byte 25.841 ns/op 28.954 ns/op 0.89
byteArrayEquals 16384 - diff last byte 24.937 us/op 26.976 us/op 0.92
Buffer.compare 16384 - diff last byte 190.54 ns/op 219.16 ns/op 0.87
byteArrayEquals 123687377 - diff last byte 188.12 ms/op 210.83 ms/op 0.89
Buffer.compare 123687377 - diff last byte 6.9837 ms/op 9.7460 ms/op 0.72
byteArrayEquals 32 - random bytes 5.4200 ns/op 5.3700 ns/op 1.01
Buffer.compare 32 - random bytes 17.685 ns/op 17.820 ns/op 0.99
byteArrayEquals 1024 - random bytes 5.2300 ns/op 5.4080 ns/op 0.97
Buffer.compare 1024 - random bytes 17.556 ns/op 17.793 ns/op 0.99
byteArrayEquals 16384 - random bytes 5.1440 ns/op 5.3870 ns/op 0.95
Buffer.compare 16384 - random bytes 17.494 ns/op 18.603 ns/op 0.94
byteArrayEquals 123687377 - random bytes 6.6200 ns/op 7.1500 ns/op 0.93
Buffer.compare 123687377 - random bytes 18.870 ns/op 21.080 ns/op 0.90
regular array get 100000 times 44.689 us/op 35.333 us/op 1.26
wrappedArray get 100000 times 42.803 us/op 34.749 us/op 1.23
arrayWithProxy get 100000 times 12.765 ms/op 15.655 ms/op 0.82
ssz.Root.equals 44.975 ns/op 49.447 ns/op 0.91
byteArrayEquals 44.358 ns/op 48.682 ns/op 0.91
Buffer.compare 10.106 ns/op 11.119 ns/op 0.91
processSlot - 1 slots 15.641 us/op 20.014 us/op 0.78
processSlot - 32 slots 2.7346 ms/op 3.7349 ms/op 0.73
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 36.897 ms/op 50.883 ms/op 0.73
getCommitteeAssignments - req 1 vs - 250000 vc 2.1042 ms/op 2.2006 ms/op 0.96
getCommitteeAssignments - req 100 vs - 250000 vc 4.0597 ms/op 4.2526 ms/op 0.95
getCommitteeAssignments - req 1000 vs - 250000 vc 4.3446 ms/op 4.6482 ms/op 0.93
findModifiedValidators - 10000 modified validators 246.25 ms/op 396.21 ms/op 0.62
findModifiedValidators - 1000 modified validators 167.75 ms/op 296.46 ms/op 0.57
findModifiedValidators - 100 modified validators 149.07 ms/op 307.81 ms/op 0.48
findModifiedValidators - 10 modified validators 142.08 ms/op 300.07 ms/op 0.47
findModifiedValidators - 1 modified validators 147.67 ms/op 224.55 ms/op 0.66
findModifiedValidators - no difference 146.90 ms/op 245.94 ms/op 0.60
compare ViewDUs 3.1075 s/op 3.9713 s/op 0.78
compare each validator Uint8Array 1.2786 s/op 1.3887 s/op 0.92
compare ViewDU to Uint8Array 1.2493 s/op 1.2023 s/op 1.04
migrate state 1000000 validators, 24 modified, 0 new 839.61 ms/op 748.29 ms/op 1.12
migrate state 1000000 validators, 1700 modified, 1000 new 1.0119 s/op 1.1640 s/op 0.87
migrate state 1000000 validators, 3400 modified, 2000 new 1.8401 s/op 1.4018 s/op 1.31
migrate state 1500000 validators, 24 modified, 0 new 951.43 ms/op 753.80 ms/op 1.26
migrate state 1500000 validators, 1700 modified, 1000 new 972.78 ms/op 1.0338 s/op 0.94
migrate state 1500000 validators, 3400 modified, 2000 new 1.1831 s/op 1.1718 s/op 1.01
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.3900 ns/op 4.3500 ns/op 1.01
state getBlockRootAtSlot - 250000 vs - 7PWei 578.28 ns/op 698.53 ns/op 0.83
computeProposers - vc 250000 7.1611 ms/op 7.4820 ms/op 0.96
computeEpochShuffling - vc 250000 41.872 ms/op 42.979 ms/op 0.97
getNextSyncCommittee - vc 250000 125.44 ms/op 122.33 ms/op 1.03
computeSigningRoot for AttestationData 18.908 us/op 21.605 us/op 0.88
hash AttestationData serialized data then Buffer.toString(base64) 1.6040 us/op 1.5243 us/op 1.05
toHexString serialized data 903.60 ns/op 877.28 ns/op 1.03
Buffer.toString(base64) 185.63 ns/op 173.27 ns/op 1.07
nodejs block root to RootHex using toHex 162.83 ns/op 146.56 ns/op 1.11
nodejs block root to RootHex using toRootHex 99.097 ns/op 91.680 ns/op 1.08
browser block root to RootHex using the deprecated toHexString 230.66 ns/op 222.64 ns/op 1.04
browser block root to RootHex using toHex 187.06 ns/op 178.65 ns/op 1.05
browser block root to RootHex using toRootHex 172.34 ns/op 159.77 ns/op 1.08

by benchmarkbot/action

Copy link

codecov bot commented Feb 27, 2024

Codecov Report

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

Project coverage is 48.51%. Comparing base (376fe2a) to head (7072661).

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #6483      +/-   ##
============================================
- Coverage     48.51%   48.51%   -0.01%     
============================================
  Files           600      600              
  Lines         40142    40150       +8     
  Branches       2057     2058       +1     
============================================
+ Hits          19475    19477       +2     
- Misses        20629    20635       +6     
  Partials         38       38              

Copy link
Member

@matthewkeil matthewkeil left a comment

Choose a reason for hiding this comment

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

The code LGTM! 🚀

Just the tiny question on the perf output but not something I feel strongly about. Truth be told we wont be looking at them much once this is merged. Neurosis is strong with this one... 😆 ... sigh....

Grafana is not wanting to load. Will click the approve once I can post some metrics here

@matthewkeil
Copy link
Member

Metrics for "till recieved" beacon block which should correlate to reduction in snappy decompression. Seeing slightly better speed on mainnet but similar results on the large validating nodes

lg1k servers

stable

Screenshot 2024-03-04 at 12 02 49 PM

unstable

Screenshot 2024-03-04 at 12 03 14 PM

feat3

Screenshot 2024-03-04 at 12 03 55 PM

mainnet servers

stable

Server unstable. Invalid metrics

unstable

Screenshot 2024-03-04 at 12 06 59 PM

feat3

Screenshot 2024-03-04 at 12 06 38 PM

import {itBench} from "@dapplion/benchmark";

describe("network / gossip / snappy", () => {
const msgLens = [100, 200, 300, 400, 500, 1000, 10000, 100000];
Copy link
Contributor

Choose a reason for hiding this comment

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

I used to see blocks with 2MB, need to add 2MB, 5MB and 10MB (max size of gossip message) message length

@twoeths
Copy link
Contributor

twoeths commented Mar 4, 2024

the optimization is in us per message so it's not easy to find an improvement on "received block time" metric. As long as we don't see memory issues I think it's good to go

@matthewkeil
Copy link
Member

looks like the metrics may not be panning out for this branch. It doesnt seem like there is a notable performance gain and the memory consumption is way up. Also seems a bit less stable with RSS bouncing around a lot on longer timeframes.

unstable-mainnet (4 days)

Screenshot 2024-03-05 at 4 26 02 PM

feat3-mainnet (4 days)

Screenshot 2024-03-05 at 4 26 08 PM

unstable-lg1k (24hr)

Screenshot 2024-03-05 at 4 27 39 PM

feat3-lg1k (24hr)

Screenshot 2024-03-05 at 4 27 47 PM

@philknows
Copy link
Member

Just noting based on standup today that we will need to deploy via Docker for testing this one.

@wemeetagain
Copy link
Member Author

wemeetagain commented Jul 24, 2024

A new contender has emerged (two years ago) snappy-wasm

Refreshed this branch and the benchmark results, check the description

Also redeployed to feat3

@wemeetagain
Copy link
Member Author

Uploading a few juicy looking data points

Screenshot from 2024-07-31 11-12-59
Screenshot from 2024-07-31 11-14-16
Screenshot from 2024-07-31 11-14-50
Screenshot from 2024-07-31 11-16-39
Screenshot from 2024-07-31 11-19-26

@wemeetagain wemeetagain changed the title feat: use snappy for larger gossip payloads feat: use snappy-wasm Aug 4, 2024
@philknows philknows added this to the v1.22.0 milestone Sep 3, 2024
@philknows philknows modified the milestones: v1.22.0, v1.23.0 Sep 11, 2024
@philknows philknows removed this from the v1.23.0 milestone Dec 3, 2024
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.

Consider using snappy along with snappyjs
4 participants