-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
base: unstable
Are you sure you want to change the base?
feat: use snappy-wasm #6483
Conversation
Benchmarks show `snappy` is faster at compressing and uncompressing larger payloads than `snappyjs`.
|
Benchmark suite | Current: ac6b54f | Previous: de0d6ab | Ratio |
---|---|---|---|
forkChoice updateHead vc 600000 bc 64 eq 300000 | 39.657 ms/op | 11.784 ms/op | 3.37 |
Full benchmark results
Benchmark suite | Current: ac6b54f | Previous: de0d6ab | Ratio |
---|---|---|---|
getPubkeys - index2pubkey - req 1000 vs - 250000 vc | 2.0003 ms/op | 1.7183 ms/op | 1.16 |
getPubkeys - validatorsArr - req 1000 vs - 250000 vc | 60.236 us/op | 37.146 us/op | 1.62 |
BLS verify - blst | 934.62 us/op | 905.57 us/op | 1.03 |
BLS verifyMultipleSignatures 3 - blst | 1.3992 ms/op | 1.3407 ms/op | 1.04 |
BLS verifyMultipleSignatures 8 - blst | 2.0521 ms/op | 2.5955 ms/op | 0.79 |
BLS verifyMultipleSignatures 32 - blst | 5.8436 ms/op | 4.5610 ms/op | 1.28 |
BLS verifyMultipleSignatures 64 - blst | 9.8788 ms/op | 8.4932 ms/op | 1.16 |
BLS verifyMultipleSignatures 128 - blst | 17.630 ms/op | 16.014 ms/op | 1.10 |
BLS deserializing 10000 signatures | 691.54 ms/op | 626.15 ms/op | 1.10 |
BLS deserializing 100000 signatures | 6.8650 s/op | 6.3426 s/op | 1.08 |
BLS verifyMultipleSignatures - same message - 3 - blst | 1.0360 ms/op | 947.47 us/op | 1.09 |
BLS verifyMultipleSignatures - same message - 8 - blst | 1.1148 ms/op | 1.0534 ms/op | 1.06 |
BLS verifyMultipleSignatures - same message - 32 - blst | 1.8309 ms/op | 1.6538 ms/op | 1.11 |
BLS verifyMultipleSignatures - same message - 64 - blst | 2.8308 ms/op | 2.4378 ms/op | 1.16 |
BLS verifyMultipleSignatures - same message - 128 - blst | 4.5569 ms/op | 4.2739 ms/op | 1.07 |
BLS aggregatePubkeys 32 - blst | 19.892 us/op | 17.835 us/op | 1.12 |
BLS aggregatePubkeys 128 - blst | 70.293 us/op | 63.594 us/op | 1.11 |
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 | 80.395 ms/op | 70.717 ms/op | 1.14 |
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 | 59.147 ms/op | 41.418 ms/op | 1.43 |
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 | 48.158 ms/op | 41.765 ms/op | 1.15 |
getSlashingsAndExits - default max | 130.06 us/op | 63.632 us/op | 2.04 |
getSlashingsAndExits - 2k | 365.29 us/op | 247.29 us/op | 1.48 |
proposeBlockBody type=full, size=empty | 7.1901 ms/op | 4.9248 ms/op | 1.46 |
isKnown best case - 1 super set check | 570.00 ns/op | 465.00 ns/op | 1.23 |
isKnown normal case - 2 super set checks | 542.00 ns/op | 457.00 ns/op | 1.19 |
isKnown worse case - 16 super set checks | 531.00 ns/op | 461.00 ns/op | 1.15 |
InMemoryCheckpointStateCache - add get delete | 3.2860 us/op | 2.8650 us/op | 1.15 |
updateUnfinalizedPubkeys - updating 10 pubkeys | 1.8565 ms/op | 804.08 us/op | 2.31 |
updateUnfinalizedPubkeys - updating 100 pubkeys | 4.6717 ms/op | 3.1182 ms/op | 1.50 |
updateUnfinalizedPubkeys - updating 1000 pubkeys | 63.027 ms/op | 41.093 ms/op | 1.53 |
validate api signedAggregateAndProof - struct | 1.5904 ms/op | 1.4519 ms/op | 1.10 |
validate gossip signedAggregateAndProof - struct | 1.5523 ms/op | 2.0245 ms/op | 0.77 |
batch validate gossip attestation - vc 640000 - chunk 32 | 142.96 us/op | 126.33 us/op | 1.13 |
batch validate gossip attestation - vc 640000 - chunk 64 | 129.89 us/op | 109.96 us/op | 1.18 |
batch validate gossip attestation - vc 640000 - chunk 128 | 113.94 us/op | 105.89 us/op | 1.08 |
batch validate gossip attestation - vc 640000 - chunk 256 | 114.64 us/op | 99.791 us/op | 1.15 |
pickEth1Vote - no votes | 1.2957 ms/op | 840.40 us/op | 1.54 |
pickEth1Vote - max votes | 8.4439 ms/op | 8.3039 ms/op | 1.02 |
pickEth1Vote - Eth1Data hashTreeRoot value x2048 | 17.099 ms/op | 20.749 ms/op | 0.82 |
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 | 25.848 ms/op | 31.035 ms/op | 0.83 |
pickEth1Vote - Eth1Data fastSerialize value x2048 | 583.04 us/op | 390.97 us/op | 1.49 |
pickEth1Vote - Eth1Data fastSerialize tree x2048 | 3.6557 ms/op | 5.2330 ms/op | 0.70 |
bytes32 toHexString | 592.00 ns/op | 807.00 ns/op | 0.73 |
bytes32 Buffer.toString(hex) | 295.00 ns/op | 489.00 ns/op | 0.60 |
bytes32 Buffer.toString(hex) from Uint8Array | 484.00 ns/op | 595.00 ns/op | 0.81 |
bytes32 Buffer.toString(hex) + 0x | 278.00 ns/op | 488.00 ns/op | 0.57 |
Object access 1 prop | 0.15700 ns/op | 0.34000 ns/op | 0.46 |
Map access 1 prop | 0.13700 ns/op | 0.32400 ns/op | 0.42 |
Object get x1000 | 6.0630 ns/op | 5.0250 ns/op | 1.21 |
Map get x1000 | 6.5070 ns/op | 5.7550 ns/op | 1.13 |
Object set x1000 | 40.468 ns/op | 27.231 ns/op | 1.49 |
Map set x1000 | 23.846 ns/op | 19.840 ns/op | 1.20 |
Return object 10000 times | 0.29880 ns/op | 0.29480 ns/op | 1.01 |
Throw Error 10000 times | 3.4240 us/op | 2.6575 us/op | 1.29 |
toHex | 152.85 ns/op | 119.78 ns/op | 1.28 |
Buffer.from | 143.04 ns/op | 98.237 ns/op | 1.46 |
shared Buffer | 89.855 ns/op | 66.791 ns/op | 1.35 |
fastMsgIdFn sha256 / 200 bytes | 2.3360 us/op | 2.0190 us/op | 1.16 |
fastMsgIdFn h32 xxhash / 200 bytes | 298.00 ns/op | 426.00 ns/op | 0.70 |
fastMsgIdFn h64 xxhash / 200 bytes | 293.00 ns/op | 454.00 ns/op | 0.65 |
fastMsgIdFn sha256 / 1000 bytes | 7.7540 us/op | 5.8230 us/op | 1.33 |
fastMsgIdFn h32 xxhash / 1000 bytes | 426.00 ns/op | 553.00 ns/op | 0.77 |
fastMsgIdFn h64 xxhash / 1000 bytes | 368.00 ns/op | 507.00 ns/op | 0.73 |
fastMsgIdFn sha256 / 10000 bytes | 68.908 us/op | 46.684 us/op | 1.48 |
fastMsgIdFn h32 xxhash / 10000 bytes | 2.0150 us/op | 1.9090 us/op | 1.06 |
fastMsgIdFn h64 xxhash / 10000 bytes | 1.2730 us/op | 1.3160 us/op | 0.97 |
100 bytes - compress - snappyjs | 2.0393 us/op | ||
100 bytes - compress - snappy | 1.3699 us/op | ||
100 bytes - compress - snappy-wasm | 878.82 ns/op | ||
100 bytes - compress - snappy-wasm - prealloc | 503.76 ns/op | ||
200 bytes - compress - snappyjs | 2.2728 us/op | ||
200 bytes - compress - snappy | 1.8391 us/op | ||
200 bytes - compress - snappy-wasm | 1.6729 us/op | ||
200 bytes - compress - snappy-wasm - prealloc | 543.32 ns/op | ||
300 bytes - compress - snappyjs | 2.8373 us/op | ||
300 bytes - compress - snappy | 1.8133 us/op | ||
300 bytes - compress - snappy-wasm | 1.6156 us/op | ||
300 bytes - compress - snappy-wasm - prealloc | 682.26 ns/op | ||
400 bytes - compress - snappyjs | 2.8117 us/op | ||
400 bytes - compress - snappy | 1.7121 us/op | ||
400 bytes - compress - snappy-wasm | 1.7104 us/op | ||
400 bytes - compress - snappy-wasm - prealloc | 723.48 ns/op | ||
500 bytes - compress - snappyjs | 3.2303 us/op | ||
500 bytes - compress - snappy | 1.9797 us/op | ||
500 bytes - compress - snappy-wasm | 1.8612 us/op | ||
500 bytes - compress - snappy-wasm - prealloc | 850.45 ns/op | ||
1000 bytes - compress - snappyjs | 5.6511 us/op | ||
1000 bytes - compress - snappy | 4.2932 us/op | ||
1000 bytes - compress - snappy-wasm | 2.6450 us/op | ||
1000 bytes - compress - snappy-wasm - prealloc | 1.2437 us/op | ||
10000 bytes - compress - snappyjs | 33.846 us/op | ||
10000 bytes - compress - snappy | 55.452 us/op | ||
10000 bytes - compress - snappy-wasm | 8.8565 us/op | ||
10000 bytes - compress - snappy-wasm - prealloc | 8.5983 us/op | ||
100000 bytes - compress - snappyjs | 220.02 us/op | ||
100000 bytes - compress - snappy | 124.15 us/op | ||
100000 bytes - compress - snappy-wasm | 48.187 us/op | ||
100000 bytes - compress - snappy-wasm - prealloc | 45.645 us/op | ||
100 bytes - uncompress - snappyjs | 872.77 ns/op | ||
100 bytes - uncompress - snappy | 1.4610 us/op | ||
100 bytes - uncompress - snappy-wasm | 713.70 ns/op | ||
100 bytes - uncompress - snappy-wasm - prealloc | 403.23 ns/op | ||
200 bytes - uncompress - snappyjs | 1.1174 us/op | ||
200 bytes - uncompress - snappy | 1.6781 us/op | ||
200 bytes - uncompress - snappy-wasm | 1.4318 us/op | ||
200 bytes - uncompress - snappy-wasm - prealloc | 452.52 ns/op | ||
300 bytes - uncompress - snappyjs | 1.9122 us/op | ||
300 bytes - uncompress - snappy | 1.7265 us/op | ||
300 bytes - uncompress - snappy-wasm | 1.1977 us/op | ||
300 bytes - uncompress - snappy-wasm - prealloc | 535.18 ns/op | ||
400 bytes - uncompress - snappyjs | 2.0668 us/op | ||
400 bytes - uncompress - snappy | 1.9957 us/op | ||
400 bytes - uncompress - snappy-wasm | 1.8511 us/op | ||
400 bytes - uncompress - snappy-wasm - prealloc | 621.31 ns/op | ||
500 bytes - uncompress - snappyjs | 1.9768 us/op | ||
500 bytes - uncompress - snappy | 1.7525 us/op | ||
500 bytes - uncompress - snappy-wasm | 1.8024 us/op | ||
500 bytes - uncompress - snappy-wasm - prealloc | 618.83 ns/op | ||
1000 bytes - uncompress - snappyjs | 2.4056 us/op | ||
1000 bytes - uncompress - snappy | 3.6066 us/op | ||
1000 bytes - uncompress - snappy-wasm | 1.5233 us/op | ||
1000 bytes - uncompress - snappy-wasm - prealloc | 832.45 ns/op | ||
10000 bytes - uncompress - snappyjs | 14.664 us/op | ||
10000 bytes - uncompress - snappy | 35.375 us/op | ||
10000 bytes - uncompress - snappy-wasm | 5.0979 us/op | ||
10000 bytes - uncompress - snappy-wasm - prealloc | 4.9212 us/op | ||
100000 bytes - uncompress - snappyjs | 147.42 us/op | ||
100000 bytes - uncompress - snappy | 98.910 us/op | ||
100000 bytes - uncompress - snappy-wasm | 42.519 us/op | ||
100000 bytes - uncompress - snappy-wasm - prealloc | 38.714 us/op | ||
send data - 1000 256B messages | 13.802 ms/op | 11.863 ms/op | 1.16 |
send data - 1000 512B messages | 20.982 ms/op | 14.082 ms/op | 1.49 |
send data - 1000 1024B messages | 32.255 ms/op | 21.913 ms/op | 1.47 |
send data - 1000 1200B messages | 36.446 ms/op | 22.746 ms/op | 1.60 |
send data - 1000 2048B messages | 25.445 ms/op | 30.022 ms/op | 0.85 |
send data - 1000 4096B messages | 37.465 ms/op | 27.678 ms/op | 1.35 |
send data - 1000 16384B messages | 84.012 ms/op | 63.945 ms/op | 1.31 |
send data - 1000 65536B messages | 332.98 ms/op | 236.04 ms/op | 1.41 |
enrSubnets - fastDeserialize 64 bits | 1.8200 us/op | 1.0830 us/op | 1.68 |
enrSubnets - ssz BitVector 64 bits | 494.00 ns/op | 519.00 ns/op | 0.95 |
enrSubnets - fastDeserialize 4 bits | 229.00 ns/op | 322.00 ns/op | 0.71 |
enrSubnets - ssz BitVector 4 bits | 491.00 ns/op | 535.00 ns/op | 0.92 |
prioritizePeers score -10:0 att 32-0.1 sync 2-0 | 195.40 us/op | 120.75 us/op | 1.62 |
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 | 233.90 us/op | 141.69 us/op | 1.65 |
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 | 340.42 us/op | 219.78 us/op | 1.55 |
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 | 562.64 us/op | 425.15 us/op | 1.32 |
prioritizePeers score 0:0 att 64-1 sync 4-1 | 764.54 us/op | 527.13 us/op | 1.45 |
array of 16000 items push then shift | 1.7403 us/op | 1.2816 us/op | 1.36 |
LinkedList of 16000 items push then shift | 9.0490 ns/op | 7.4570 ns/op | 1.21 |
array of 16000 items push then pop | 150.71 ns/op | 125.64 ns/op | 1.20 |
LinkedList of 16000 items push then pop | 8.8490 ns/op | 6.2970 ns/op | 1.41 |
array of 24000 items push then shift | 2.7079 us/op | 1.8973 us/op | 1.43 |
LinkedList of 24000 items push then shift | 9.8760 ns/op | 6.9310 ns/op | 1.42 |
array of 24000 items push then pop | 194.40 ns/op | 158.41 ns/op | 1.23 |
LinkedList of 24000 items push then pop | 8.3900 ns/op | 6.2220 ns/op | 1.35 |
intersect bitArray bitLen 8 | 7.4830 ns/op | 5.2700 ns/op | 1.42 |
intersect array and set length 8 | 72.989 ns/op | 40.509 ns/op | 1.80 |
intersect bitArray bitLen 128 | 36.677 ns/op | 26.214 ns/op | 1.40 |
intersect array and set length 128 | 991.97 ns/op | 647.64 ns/op | 1.53 |
bitArray.getTrueBitIndexes() bitLen 128 | 1.8550 us/op | 2.2460 us/op | 0.83 |
bitArray.getTrueBitIndexes() bitLen 248 | 2.9450 us/op | 3.4510 us/op | 0.85 |
bitArray.getTrueBitIndexes() bitLen 512 | 6.1060 us/op | 8.6390 us/op | 0.71 |
Buffer.concat 32 items | 1.0670 us/op | 1.0860 us/op | 0.98 |
Uint8Array.set 32 items | 1.7870 us/op | 1.7170 us/op | 1.04 |
Buffer.copy | 2.1090 us/op | 1.7040 us/op | 1.24 |
Uint8Array.set - with subarray | 3.1680 us/op | 2.1400 us/op | 1.48 |
Uint8Array.set - without subarray | 2.5020 us/op | 1.4640 us/op | 1.71 |
getUint32 - dataview | 322.00 ns/op | 406.00 ns/op | 0.79 |
getUint32 - manual | 266.00 ns/op | 343.00 ns/op | 0.78 |
Set add up to 64 items then delete first | 3.2164 us/op | 1.7844 us/op | 1.80 |
OrderedSet add up to 64 items then delete first | 5.1634 us/op | 2.7672 us/op | 1.87 |
Set add up to 64 items then delete last | 3.5137 us/op | 2.0333 us/op | 1.73 |
OrderedSet add up to 64 items then delete last | 5.8827 us/op | 3.0735 us/op | 1.91 |
Set add up to 64 items then delete middle | 4.4493 us/op | 2.0367 us/op | 2.18 |
OrderedSet add up to 64 items then delete middle | 8.6823 us/op | 4.5966 us/op | 1.89 |
Set add up to 128 items then delete first | 7.6982 us/op | 4.0016 us/op | 1.92 |
OrderedSet add up to 128 items then delete first | 14.287 us/op | 6.3192 us/op | 2.26 |
Set add up to 128 items then delete last | 7.5561 us/op | 3.8364 us/op | 1.97 |
OrderedSet add up to 128 items then delete last | 11.489 us/op | 5.8751 us/op | 1.96 |
Set add up to 128 items then delete middle | 7.6548 us/op | 3.8081 us/op | 2.01 |
OrderedSet add up to 128 items then delete middle | 20.871 us/op | 11.979 us/op | 1.74 |
Set add up to 256 items then delete first | 17.235 us/op | 7.8387 us/op | 2.20 |
OrderedSet add up to 256 items then delete first | 26.250 us/op | 12.585 us/op | 2.09 |
Set add up to 256 items then delete last | 14.604 us/op | 7.5312 us/op | 1.94 |
OrderedSet add up to 256 items then delete last | 26.164 us/op | 11.797 us/op | 2.22 |
Set add up to 256 items then delete middle | 15.743 us/op | 7.4386 us/op | 2.12 |
OrderedSet add up to 256 items then delete middle | 56.843 us/op | 35.240 us/op | 1.61 |
transfer serialized Status (84 B) | 1.7480 us/op | 1.4970 us/op | 1.17 |
copy serialized Status (84 B) | 1.6270 us/op | 1.3040 us/op | 1.25 |
transfer serialized SignedVoluntaryExit (112 B) | 1.9450 us/op | 1.7480 us/op | 1.11 |
copy serialized SignedVoluntaryExit (112 B) | 1.7170 us/op | 1.4170 us/op | 1.21 |
transfer serialized ProposerSlashing (416 B) | 2.5120 us/op | 2.0370 us/op | 1.23 |
copy serialized ProposerSlashing (416 B) | 3.0160 us/op | 2.0880 us/op | 1.44 |
transfer serialized Attestation (485 B) | 3.2360 us/op | 2.1500 us/op | 1.51 |
copy serialized Attestation (485 B) | 3.6210 us/op | 2.1380 us/op | 1.69 |
transfer serialized AttesterSlashing (33232 B) | 3.5120 us/op | 2.7250 us/op | 1.29 |
copy serialized AttesterSlashing (33232 B) | 14.720 us/op | 6.0530 us/op | 2.43 |
transfer serialized Small SignedBeaconBlock (128000 B) | 4.7090 us/op | 3.9780 us/op | 1.18 |
copy serialized Small SignedBeaconBlock (128000 B) | 38.878 us/op | 16.287 us/op | 2.39 |
transfer serialized Avg SignedBeaconBlock (200000 B) | 6.9190 us/op | 3.9630 us/op | 1.75 |
copy serialized Avg SignedBeaconBlock (200000 B) | 54.254 us/op | 23.972 us/op | 2.26 |
transfer serialized BlobsSidecar (524380 B) | 7.2280 us/op | 3.3600 us/op | 2.15 |
copy serialized BlobsSidecar (524380 B) | 164.10 us/op | 113.65 us/op | 1.44 |
transfer serialized Big SignedBeaconBlock (1000000 B) | 9.9840 us/op | 2.9700 us/op | 3.36 |
copy serialized Big SignedBeaconBlock (1000000 B) | 284.80 us/op | 188.02 us/op | 1.51 |
pass gossip attestations to forkchoice per slot | 3.9491 ms/op | 2.5462 ms/op | 1.55 |
forkChoice updateHead vc 100000 bc 64 eq 0 | 718.04 us/op | 366.17 us/op | 1.96 |
forkChoice updateHead vc 600000 bc 64 eq 0 | 5.4898 ms/op | 2.7097 ms/op | 2.03 |
forkChoice updateHead vc 1000000 bc 64 eq 0 | 9.2812 ms/op | 3.6948 ms/op | 2.51 |
forkChoice updateHead vc 600000 bc 320 eq 0 | 5.9191 ms/op | 2.1906 ms/op | 2.70 |
forkChoice updateHead vc 600000 bc 1200 eq 0 | 5.2014 ms/op | 2.2462 ms/op | 2.32 |
forkChoice updateHead vc 600000 bc 7200 eq 0 | 7.2458 ms/op | 3.1150 ms/op | 2.33 |
forkChoice updateHead vc 600000 bc 64 eq 1000 | 12.091 ms/op | 9.5812 ms/op | 1.26 |
forkChoice updateHead vc 600000 bc 64 eq 10000 | 11.540 ms/op | 9.5213 ms/op | 1.21 |
forkChoice updateHead vc 600000 bc 64 eq 300000 | 39.657 ms/op | 11.784 ms/op | 3.37 |
computeDeltas 500000 validators 300 proto nodes | 5.7032 ms/op | 3.2398 ms/op | 1.76 |
computeDeltas 500000 validators 1200 proto nodes | 5.0431 ms/op | 3.2681 ms/op | 1.54 |
computeDeltas 500000 validators 7200 proto nodes | 4.7990 ms/op | 3.2607 ms/op | 1.47 |
computeDeltas 750000 validators 300 proto nodes | 7.7554 ms/op | 4.8665 ms/op | 1.59 |
computeDeltas 750000 validators 1200 proto nodes | 9.5480 ms/op | 4.8411 ms/op | 1.97 |
computeDeltas 750000 validators 7200 proto nodes | 8.7966 ms/op | 4.7775 ms/op | 1.84 |
computeDeltas 1400000 validators 300 proto nodes | 19.240 ms/op | 8.8315 ms/op | 2.18 |
computeDeltas 1400000 validators 1200 proto nodes | 15.907 ms/op | 9.1316 ms/op | 1.74 |
computeDeltas 1400000 validators 7200 proto nodes | 14.453 ms/op | 8.7758 ms/op | 1.65 |
computeDeltas 2100000 validators 300 proto nodes | 17.612 ms/op | 13.563 ms/op | 1.30 |
computeDeltas 2100000 validators 1200 proto nodes | 17.489 ms/op | 13.531 ms/op | 1.29 |
computeDeltas 2100000 validators 7200 proto nodes | 16.952 ms/op | 13.478 ms/op | 1.26 |
altair processAttestation - 250000 vs - 7PWei normalcase | 2.0810 ms/op | 1.3997 ms/op | 1.49 |
altair processAttestation - 250000 vs - 7PWei worstcase | 2.6342 ms/op | 2.1942 ms/op | 1.20 |
altair processAttestation - setStatus - 1/6 committees join | 91.694 us/op | 66.958 us/op | 1.37 |
altair processAttestation - setStatus - 1/3 committees join | 179.89 us/op | 141.72 us/op | 1.27 |
altair processAttestation - setStatus - 1/2 committees join | 255.50 us/op | 194.96 us/op | 1.31 |
altair processAttestation - setStatus - 2/3 committees join | 327.97 us/op | 252.07 us/op | 1.30 |
altair processAttestation - setStatus - 4/5 committees join | 491.25 us/op | 383.85 us/op | 1.28 |
altair processAttestation - setStatus - 100% committees join | 574.88 us/op | 460.59 us/op | 1.25 |
altair processBlock - 250000 vs - 7PWei normalcase | 5.0038 ms/op | 5.4814 ms/op | 0.91 |
altair processBlock - 250000 vs - 7PWei normalcase hashState | 27.998 ms/op | 23.561 ms/op | 1.19 |
altair processBlock - 250000 vs - 7PWei worstcase | 35.917 ms/op | 38.362 ms/op | 0.94 |
altair processBlock - 250000 vs - 7PWei worstcase hashState | 73.139 ms/op | 85.734 ms/op | 0.85 |
phase0 processBlock - 250000 vs - 7PWei normalcase | 2.0945 ms/op | 2.0426 ms/op | 1.03 |
phase0 processBlock - 250000 vs - 7PWei worstcase | 22.359 ms/op | 21.687 ms/op | 1.03 |
altair processEth1Data - 250000 vs - 7PWei normalcase | 327.13 us/op | 235.92 us/op | 1.39 |
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 | 5.8690 us/op | 3.5870 us/op | 1.64 |
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 | 43.797 us/op | 17.366 us/op | 2.52 |
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 | 11.442 us/op | 10.844 us/op | 1.06 |
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 | 7.5120 us/op | 5.0780 us/op | 1.48 |
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 | 134.34 us/op | 118.75 us/op | 1.13 |
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 | 1.1059 ms/op | 1.3286 ms/op | 0.83 |
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 | 1.4986 ms/op | 1.2265 ms/op | 1.22 |
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 | 1.4806 ms/op | 1.0515 ms/op | 1.41 |
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 | 3.7794 ms/op | 2.9483 ms/op | 1.28 |
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 | 1.6531 ms/op | 1.2049 ms/op | 1.37 |
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 | 3.9855 ms/op | 2.7890 ms/op | 1.43 |
Tree 40 250000 create | 296.55 ms/op | 179.09 ms/op | 1.66 |
Tree 40 250000 get(125000) | 169.15 ns/op | 101.75 ns/op | 1.66 |
Tree 40 250000 set(125000) | 780.86 ns/op | 517.05 ns/op | 1.51 |
Tree 40 250000 toArray() | 20.773 ms/op | 12.218 ms/op | 1.70 |
Tree 40 250000 iterate all - toArray() + loop | 20.207 ms/op | 12.347 ms/op | 1.64 |
Tree 40 250000 iterate all - get(i) | 58.032 ms/op | 39.782 ms/op | 1.46 |
Array 250000 create | 3.7972 ms/op | 2.4037 ms/op | 1.58 |
Array 250000 clone - spread | 1.3948 ms/op | 1.3163 ms/op | 1.06 |
Array 250000 get(125000) | 0.43100 ns/op | 0.56300 ns/op | 0.77 |
Array 250000 set(125000) | 0.44700 ns/op | 0.56400 ns/op | 0.79 |
Array 250000 iterate all - loop | 96.837 us/op | 72.363 us/op | 1.34 |
phase0 afterProcessEpoch - 250000 vs - 7PWei | 53.095 ms/op | 39.430 ms/op | 1.35 |
Array.fill - length 1000000 | 5.2873 ms/op | 2.4982 ms/op | 2.12 |
Array push - length 1000000 | 20.795 ms/op | 14.061 ms/op | 1.48 |
Array.get | 0.31387 ns/op | 0.25331 ns/op | 1.24 |
Uint8Array.get | 0.45520 ns/op | 0.32592 ns/op | 1.40 |
phase0 beforeProcessEpoch - 250000 vs - 7PWei | 21.910 ms/op | 15.385 ms/op | 1.42 |
altair processEpoch - mainnet_e81889 | 323.29 ms/op | 278.69 ms/op | 1.16 |
mainnet_e81889 - altair beforeProcessEpoch | 19.155 ms/op | 16.290 ms/op | 1.18 |
mainnet_e81889 - altair processJustificationAndFinalization | 20.006 us/op | 10.909 us/op | 1.83 |
mainnet_e81889 - altair processInactivityUpdates | 8.3269 ms/op | 4.1307 ms/op | 2.02 |
mainnet_e81889 - altair processRewardsAndPenalties | 44.548 ms/op | 55.977 ms/op | 0.80 |
mainnet_e81889 - altair processRegistryUpdates | 2.8170 us/op | 1.3450 us/op | 2.09 |
mainnet_e81889 - altair processSlashings | 843.00 ns/op | 823.00 ns/op | 1.02 |
mainnet_e81889 - altair processEth1DataReset | 784.00 ns/op | 748.00 ns/op | 1.05 |
mainnet_e81889 - altair processEffectiveBalanceUpdates | 1.9477 ms/op | 1.6386 ms/op | 1.19 |
mainnet_e81889 - altair processSlashingsReset | 5.1550 us/op | 2.1560 us/op | 2.39 |
mainnet_e81889 - altair processRandaoMixesReset | 9.0090 us/op | 2.7200 us/op | 3.31 |
mainnet_e81889 - altair processHistoricalRootsUpdate | 1.6890 us/op | 692.00 ns/op | 2.44 |
mainnet_e81889 - altair processParticipationFlagUpdates | 3.9840 us/op | 1.8100 us/op | 2.20 |
mainnet_e81889 - altair processSyncCommitteeUpdates | 1.0450 us/op | 703.00 ns/op | 1.49 |
mainnet_e81889 - altair afterProcessEpoch | 56.291 ms/op | 41.143 ms/op | 1.37 |
capella processEpoch - mainnet_e217614 | 1.3098 s/op | 965.12 ms/op | 1.36 |
mainnet_e217614 - capella beforeProcessEpoch | 83.481 ms/op | 68.213 ms/op | 1.22 |
mainnet_e217614 - capella processJustificationAndFinalization | 21.912 us/op | 11.636 us/op | 1.88 |
mainnet_e217614 - capella processInactivityUpdates | 17.246 ms/op | 12.576 ms/op | 1.37 |
mainnet_e217614 - capella processRewardsAndPenalties | 240.06 ms/op | 220.74 ms/op | 1.09 |
mainnet_e217614 - capella processRegistryUpdates | 19.083 us/op | 13.795 us/op | 1.38 |
mainnet_e217614 - capella processSlashings | 545.00 ns/op | 740.00 ns/op | 0.74 |
mainnet_e217614 - capella processEth1DataReset | 560.00 ns/op | 714.00 ns/op | 0.78 |
mainnet_e217614 - capella processEffectiveBalanceUpdates | 6.4956 ms/op | 13.243 ms/op | 0.49 |
mainnet_e217614 - capella processSlashingsReset | 5.8540 us/op | 2.4310 us/op | 2.41 |
mainnet_e217614 - capella processRandaoMixesReset | 9.7250 us/op | 10.228 us/op | 0.95 |
mainnet_e217614 - capella processHistoricalRootsUpdate | 1.6550 us/op | 1.0120 us/op | 1.64 |
mainnet_e217614 - capella processParticipationFlagUpdates | 3.9680 us/op | 2.2060 us/op | 1.80 |
mainnet_e217614 - capella afterProcessEpoch | 129.54 ms/op | 106.38 ms/op | 1.22 |
phase0 processEpoch - mainnet_e58758 | 330.64 ms/op | 345.60 ms/op | 0.96 |
mainnet_e58758 - phase0 beforeProcessEpoch | 94.894 ms/op | 87.280 ms/op | 1.09 |
mainnet_e58758 - phase0 processJustificationAndFinalization | 19.420 us/op | 13.319 us/op | 1.46 |
mainnet_e58758 - phase0 processRewardsAndPenalties | 33.554 ms/op | 26.270 ms/op | 1.28 |
mainnet_e58758 - phase0 processRegistryUpdates | 15.395 us/op | 5.5300 us/op | 2.78 |
mainnet_e58758 - phase0 processSlashings | 691.00 ns/op | 770.00 ns/op | 0.90 |
mainnet_e58758 - phase0 processEth1DataReset | 608.00 ns/op | 719.00 ns/op | 0.85 |
mainnet_e58758 - phase0 processEffectiveBalanceUpdates | 1.6558 ms/op | 1.3597 ms/op | 1.22 |
mainnet_e58758 - phase0 processSlashingsReset | 5.4160 us/op | 2.3320 us/op | 2.32 |
mainnet_e58758 - phase0 processRandaoMixesReset | 8.3010 us/op | 3.2170 us/op | 2.58 |
mainnet_e58758 - phase0 processHistoricalRootsUpdate | 1.3250 us/op | 776.00 ns/op | 1.71 |
mainnet_e58758 - phase0 processParticipationRecordUpdates | 7.1980 us/op | 3.1250 us/op | 2.30 |
mainnet_e58758 - phase0 afterProcessEpoch | 46.751 ms/op | 34.321 ms/op | 1.36 |
phase0 processEffectiveBalanceUpdates - 250000 normalcase | 1.9178 ms/op | 1.6808 ms/op | 1.14 |
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 | 3.8408 ms/op | 1.6333 ms/op | 2.35 |
altair processInactivityUpdates - 250000 normalcase | 21.460 ms/op | 17.134 ms/op | 1.25 |
altair processInactivityUpdates - 250000 worstcase | 19.184 ms/op | 16.320 ms/op | 1.18 |
phase0 processRegistryUpdates - 250000 normalcase | 13.445 us/op | 5.6000 us/op | 2.40 |
phase0 processRegistryUpdates - 250000 badcase_full_deposits | 318.61 us/op | 312.49 us/op | 1.02 |
phase0 processRegistryUpdates - 250000 worstcase 0.5 | 136.87 ms/op | 110.94 ms/op | 1.23 |
altair processRewardsAndPenalties - 250000 normalcase | 48.772 ms/op | 41.598 ms/op | 1.17 |
altair processRewardsAndPenalties - 250000 worstcase | 44.568 ms/op | 33.371 ms/op | 1.34 |
phase0 getAttestationDeltas - 250000 normalcase | 8.5211 ms/op | 6.4047 ms/op | 1.33 |
phase0 getAttestationDeltas - 250000 worstcase | 8.2501 ms/op | 5.8999 ms/op | 1.40 |
phase0 processSlashings - 250000 worstcase | 126.26 us/op | 81.890 us/op | 1.54 |
altair processSyncCommitteeUpdates - 250000 | 137.67 ms/op | 94.417 ms/op | 1.46 |
BeaconState.hashTreeRoot - No change | 250.00 ns/op | 433.00 ns/op | 0.58 |
BeaconState.hashTreeRoot - 1 full validator | 104.81 us/op | 111.85 us/op | 0.94 |
BeaconState.hashTreeRoot - 32 full validator | 1.0760 ms/op | 1.1559 ms/op | 0.93 |
BeaconState.hashTreeRoot - 512 full validator | 10.749 ms/op | 9.0742 ms/op | 1.18 |
BeaconState.hashTreeRoot - 1 validator.effectiveBalance | 130.20 us/op | 119.37 us/op | 1.09 |
BeaconState.hashTreeRoot - 32 validator.effectiveBalance | 1.9896 ms/op | 1.8957 ms/op | 1.05 |
BeaconState.hashTreeRoot - 512 validator.effectiveBalance | 22.381 ms/op | 22.872 ms/op | 0.98 |
BeaconState.hashTreeRoot - 1 balances | 116.77 us/op | 107.81 us/op | 1.08 |
BeaconState.hashTreeRoot - 32 balances | 873.71 us/op | 1.0188 ms/op | 0.86 |
BeaconState.hashTreeRoot - 512 balances | 10.102 ms/op | 6.6326 ms/op | 1.52 |
BeaconState.hashTreeRoot - 250000 balances | 180.50 ms/op | 149.20 ms/op | 1.21 |
aggregationBits - 2048 els - zipIndexesInBitList | 25.137 us/op | 44.387 us/op | 0.57 |
byteArrayEquals 32 | 54.328 ns/op | 48.995 ns/op | 1.11 |
Buffer.compare 32 | 17.314 ns/op | 15.863 ns/op | 1.09 |
byteArrayEquals 1024 | 1.5875 us/op | 1.2943 us/op | 1.23 |
Buffer.compare 1024 | 25.851 ns/op | 24.342 ns/op | 1.06 |
byteArrayEquals 16384 | 26.016 us/op | 20.492 us/op | 1.27 |
Buffer.compare 16384 | 197.51 ns/op | 211.94 ns/op | 0.93 |
byteArrayEquals 123687377 | 196.72 ms/op | 151.11 ms/op | 1.30 |
Buffer.compare 123687377 | 9.3961 ms/op | 5.4824 ms/op | 1.71 |
byteArrayEquals 32 - diff last byte | 53.505 ns/op | 44.901 ns/op | 1.19 |
Buffer.compare 32 - diff last byte | 17.916 ns/op | 15.056 ns/op | 1.19 |
byteArrayEquals 1024 - diff last byte | 1.6003 us/op | 1.2103 us/op | 1.32 |
Buffer.compare 1024 - diff last byte | 25.714 ns/op | 24.005 ns/op | 1.07 |
byteArrayEquals 16384 - diff last byte | 25.853 us/op | 19.086 us/op | 1.35 |
Buffer.compare 16384 - diff last byte | 202.79 ns/op | 193.78 ns/op | 1.05 |
byteArrayEquals 123687377 - diff last byte | 194.98 ms/op | 149.48 ms/op | 1.30 |
Buffer.compare 123687377 - diff last byte | 8.6349 ms/op | 3.7173 ms/op | 2.32 |
byteArrayEquals 32 - random bytes | 5.2390 ns/op | 4.8390 ns/op | 1.08 |
Buffer.compare 32 - random bytes | 18.179 ns/op | 16.581 ns/op | 1.10 |
byteArrayEquals 1024 - random bytes | 5.2790 ns/op | 4.8860 ns/op | 1.08 |
Buffer.compare 1024 - random bytes | 18.027 ns/op | 15.835 ns/op | 1.14 |
byteArrayEquals 16384 - random bytes | 5.2300 ns/op | 4.8280 ns/op | 1.08 |
Buffer.compare 16384 - random bytes | 17.492 ns/op | 16.472 ns/op | 1.06 |
byteArrayEquals 123687377 - random bytes | 6.4000 ns/op | 7.7300 ns/op | 0.83 |
Buffer.compare 123687377 - random bytes | 18.720 ns/op | 19.230 ns/op | 0.97 |
regular array get 100000 times | 41.239 us/op | 30.671 us/op | 1.34 |
wrappedArray get 100000 times | 31.653 us/op | 30.631 us/op | 1.03 |
arrayWithProxy get 100000 times | 14.948 ms/op | 9.0841 ms/op | 1.65 |
ssz.Root.equals | 47.449 ns/op | 40.830 ns/op | 1.16 |
byteArrayEquals | 44.966 ns/op | 39.044 ns/op | 1.15 |
Buffer.compare | 10.310 ns/op | 8.2280 ns/op | 1.25 |
processSlot - 1 slots | 13.774 us/op | 15.216 us/op | 0.91 |
processSlot - 32 slots | 3.0773 ms/op | 2.7862 ms/op | 1.10 |
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei | 35.012 ms/op | 41.041 ms/op | 0.85 |
getCommitteeAssignments - req 1 vs - 250000 vc | 2.0867 ms/op | 1.7195 ms/op | 1.21 |
getCommitteeAssignments - req 100 vs - 250000 vc | 4.0331 ms/op | 3.4603 ms/op | 1.17 |
getCommitteeAssignments - req 1000 vs - 250000 vc | 4.4166 ms/op | 3.6948 ms/op | 1.20 |
findModifiedValidators - 10000 modified validators | 237.81 ms/op | 223.07 ms/op | 1.07 |
findModifiedValidators - 1000 modified validators | 189.12 ms/op | 139.22 ms/op | 1.36 |
findModifiedValidators - 100 modified validators | 203.38 ms/op | 139.41 ms/op | 1.46 |
findModifiedValidators - 10 modified validators | 190.15 ms/op | 142.44 ms/op | 1.34 |
findModifiedValidators - 1 modified validators | 177.19 ms/op | 120.70 ms/op | 1.47 |
findModifiedValidators - no difference | 172.43 ms/op | 142.71 ms/op | 1.21 |
compare ViewDUs | 3.2315 s/op | 2.9467 s/op | 1.10 |
compare each validator Uint8Array | 1.5546 s/op | 1.6494 s/op | 0.94 |
compare ViewDU to Uint8Array | 1.3225 s/op | 730.18 ms/op | 1.81 |
migrate state 1000000 validators, 24 modified, 0 new | 852.62 ms/op | 713.73 ms/op | 1.19 |
migrate state 1000000 validators, 1700 modified, 1000 new | 1.0508 s/op | 963.65 ms/op | 1.09 |
migrate state 1000000 validators, 3400 modified, 2000 new | 1.2398 s/op | 1.1693 s/op | 1.06 |
migrate state 1500000 validators, 24 modified, 0 new | 835.72 ms/op | 709.21 ms/op | 1.18 |
migrate state 1500000 validators, 1700 modified, 1000 new | 926.04 ms/op | 893.32 ms/op | 1.04 |
migrate state 1500000 validators, 3400 modified, 2000 new | 1.0666 s/op | 1.0812 s/op | 0.99 |
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei | 4.4000 ns/op | 6.1700 ns/op | 0.71 |
state getBlockRootAtSlot - 250000 vs - 7PWei | 604.64 ns/op | 611.33 ns/op | 0.99 |
computeProposers - vc 250000 | 6.9650 ms/op | 5.2258 ms/op | 1.33 |
computeEpochShuffling - vc 250000 | 41.507 ms/op | 33.809 ms/op | 1.23 |
getNextSyncCommittee - vc 250000 | 131.72 ms/op | 99.630 ms/op | 1.32 |
computeSigningRoot for AttestationData | 27.567 us/op | 19.417 us/op | 1.42 |
hash AttestationData serialized data then Buffer.toString(base64) | 1.6171 us/op | 1.1259 us/op | 1.44 |
toHexString serialized data | 899.41 ns/op | 730.51 ns/op | 1.23 |
Buffer.toString(base64) | 191.93 ns/op | 123.94 ns/op | 1.55 |
nodejs block root to RootHex using toHex | 148.56 ns/op | 111.37 ns/op | 1.33 |
nodejs block root to RootHex using toRootHex | 101.91 ns/op | 67.610 ns/op | 1.51 |
browser block root to RootHex using the deprecated toHexString | 225.97 ns/op | 189.42 ns/op | 1.19 |
browser block root to RootHex using toHex | 185.46 ns/op | 154.91 ns/op | 1.20 |
browser block root to RootHex using toRootHex | 158.62 ns/op | 140.99 ns/op | 1.13 |
by benchmarkbot/action
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #6483 +/- ##
============================================
+ Coverage 49.21% 49.22% +0.01%
============================================
Files 598 598
Lines 39726 39734 +8
Branches 2092 2095 +3
============================================
+ Hits 19550 19561 +11
+ Misses 20136 20133 -3
Partials 40 40 |
There was a problem hiding this 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
import {itBench} from "@dapplion/benchmark"; | ||
|
||
describe("network / gossip / snappy", () => { | ||
const msgLens = [100, 200, 300, 400, 500, 1000, 10000, 100000]; |
There was a problem hiding this comment.
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
the optimization is in |
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.
|
Just noting based on standup today that we will need to deploy via Docker for testing this one. |
A new contender has emerged (two years ago) Refreshed this branch and the benchmark results, check the description Also redeployed to feat3 |
Motivation
Benchmarks show
snappy-wasm
is faster at compressing and uncompressing thansnappyjs
.Description
snappy-wasm
for compressing / uncompressing gossip payloadssnappy
vssnappyjs
vssnappy-wasm
benchmarksTODO
Closes #4170