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

Have fastify back as dev dependency in lodestar-api #4161

Merged
merged 1 commit into from
Jun 17, 2022

Conversation

dadepo
Copy link
Contributor

@dadepo dadepo commented Jun 15, 2022

Motivation

fastify should be a dev dependency in lodestar-api

Closes #4159

@github-actions
Copy link
Contributor

github-actions bot commented Jun 15, 2022

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 14547df Previous: 851d698 Ratio
altair processAttestation - 250000 vs - 7PWei normalcase 4.2733 ms/op 4.4101 ms/op 0.97
altair processAttestation - 250000 vs - 7PWei worstcase 7.1739 ms/op 7.8260 ms/op 0.92
altair processAttestation - setStatus - 1/6 committees join 227.74 us/op 240.00 us/op 0.95
altair processAttestation - setStatus - 1/3 committees join 432.55 us/op 464.16 us/op 0.93
altair processAttestation - setStatus - 1/2 committees join 631.57 us/op 637.02 us/op 0.99
altair processAttestation - setStatus - 2/3 committees join 777.69 us/op 818.01 us/op 0.95
altair processAttestation - setStatus - 4/5 committees join 1.1034 ms/op 1.1421 ms/op 0.97
altair processAttestation - setStatus - 100% committees join 1.3029 ms/op 1.3790 ms/op 0.94
altair processBlock - 250000 vs - 7PWei normalcase 30.382 ms/op 28.077 ms/op 1.08
altair processBlock - 250000 vs - 7PWei normalcase hashState 41.342 ms/op 39.210 ms/op 1.05
altair processBlock - 250000 vs - 7PWei worstcase 102.86 ms/op 87.646 ms/op 1.17
altair processBlock - 250000 vs - 7PWei worstcase hashState 128.65 ms/op 110.26 ms/op 1.17
phase0 processBlock - 250000 vs - 7PWei normalcase 4.3906 ms/op 4.1660 ms/op 1.05
phase0 processBlock - 250000 vs - 7PWei worstcase 64.622 ms/op 53.877 ms/op 1.20
altair processEth1Data - 250000 vs - 7PWei normalcase 893.86 us/op 825.96 us/op 1.08
Tree 40 250000 create 1.0034 s/op 904.75 ms/op 1.11
Tree 40 250000 get(125000) 332.92 ns/op 345.56 ns/op 0.96
Tree 40 250000 set(125000) 3.3507 us/op 2.9811 us/op 1.12
Tree 40 250000 toArray() 36.321 ms/op 37.380 ms/op 0.97
Tree 40 250000 iterate all - toArray() + loop 36.721 ms/op 37.865 ms/op 0.97
Tree 40 250000 iterate all - get(i) 134.66 ms/op 133.51 ms/op 1.01
MutableVector 250000 create 18.476 ms/op 20.882 ms/op 0.88
MutableVector 250000 get(125000) 14.051 ns/op 18.034 ns/op 0.78
MutableVector 250000 set(125000) 1.0132 us/op 701.35 ns/op 1.44
MutableVector 250000 toArray() 7.6385 ms/op 8.5867 ms/op 0.89
MutableVector 250000 iterate all - toArray() + loop 7.8423 ms/op 9.2685 ms/op 0.85
MutableVector 250000 iterate all - get(i) 3.6125 ms/op 3.8660 ms/op 0.93
Array 250000 create 7.4364 ms/op 7.5897 ms/op 0.98
Array 250000 clone - spread 5.0022 ms/op 4.0173 ms/op 1.25
Array 250000 get(125000) 2.0810 ns/op 1.7760 ns/op 1.17
Array 250000 set(125000) 2.1540 ns/op 1.7990 ns/op 1.20
Array 250000 iterate all - loop 148.81 us/op 202.32 us/op 0.74
effectiveBalanceIncrements clone Uint8Array 300000 135.03 us/op 98.880 us/op 1.37
effectiveBalanceIncrements clone MutableVector 300000 755.00 ns/op 1.3030 us/op 0.58
effectiveBalanceIncrements rw all Uint8Array 300000 301.32 us/op 298.36 us/op 1.01
effectiveBalanceIncrements rw all MutableVector 300000 233.38 ms/op 242.46 ms/op 0.96
phase0 afterProcessEpoch - 250000 vs - 7PWei 217.80 ms/op 227.14 ms/op 0.96
phase0 beforeProcessEpoch - 250000 vs - 7PWei 78.211 ms/op 110.87 ms/op 0.71
altair processEpoch - mainnet_e81889 640.10 ms/op 675.39 ms/op 0.95
mainnet_e81889 - altair beforeProcessEpoch 149.68 ms/op 170.94 ms/op 0.88
mainnet_e81889 - altair processJustificationAndFinalization 66.831 us/op 34.778 us/op 1.92
mainnet_e81889 - altair processInactivityUpdates 12.836 ms/op 13.091 ms/op 0.98
mainnet_e81889 - altair processRewardsAndPenalties 151.56 ms/op 100.42 ms/op 1.51
mainnet_e81889 - altair processRegistryUpdates 17.442 us/op 7.0680 us/op 2.47
mainnet_e81889 - altair processSlashings 4.0950 us/op 2.2540 us/op 1.82
mainnet_e81889 - altair processEth1DataReset 4.1130 us/op 2.0620 us/op 1.99
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.6505 ms/op 2.8894 ms/op 0.92
mainnet_e81889 - altair processSlashingsReset 22.876 us/op 11.506 us/op 1.99
mainnet_e81889 - altair processRandaoMixesReset 25.748 us/op 13.252 us/op 1.94
mainnet_e81889 - altair processHistoricalRootsUpdate 4.2500 us/op 2.0160 us/op 2.11
mainnet_e81889 - altair processParticipationFlagUpdates 13.193 us/op 7.4940 us/op 1.76
mainnet_e81889 - altair processSyncCommitteeUpdates 3.6490 us/op 1.8740 us/op 1.95
mainnet_e81889 - altair afterProcessEpoch 217.56 ms/op 238.09 ms/op 0.91
phase0 processEpoch - mainnet_e58758 623.56 ms/op 618.10 ms/op 1.01
mainnet_e58758 - phase0 beforeProcessEpoch 252.52 ms/op 232.26 ms/op 1.09
mainnet_e58758 - phase0 processJustificationAndFinalization 59.932 us/op 30.343 us/op 1.98
mainnet_e58758 - phase0 processRewardsAndPenalties 80.023 ms/op 86.696 ms/op 0.92
mainnet_e58758 - phase0 processRegistryUpdates 32.819 us/op 17.331 us/op 1.89
mainnet_e58758 - phase0 processSlashings 3.0370 us/op 1.7640 us/op 1.72
mainnet_e58758 - phase0 processEth1DataReset 3.1920 us/op 1.7700 us/op 1.80
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.4442 ms/op 2.4752 ms/op 0.99
mainnet_e58758 - phase0 processSlashingsReset 17.505 us/op 9.7790 us/op 1.79
mainnet_e58758 - phase0 processRandaoMixesReset 23.905 us/op 13.194 us/op 1.81
mainnet_e58758 - phase0 processHistoricalRootsUpdate 3.8440 us/op 2.1500 us/op 1.79
mainnet_e58758 - phase0 processParticipationRecordUpdates 22.158 us/op 12.794 us/op 1.73
mainnet_e58758 - phase0 afterProcessEpoch 182.51 ms/op 196.12 ms/op 0.93
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.6786 ms/op 3.6090 ms/op 0.74
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.7316 ms/op 4.0792 ms/op 0.67
altair processInactivityUpdates - 250000 normalcase 34.752 ms/op 31.101 ms/op 1.12
altair processInactivityUpdates - 250000 worstcase 44.093 ms/op 38.531 ms/op 1.14
phase0 processRegistryUpdates - 250000 normalcase 27.522 us/op 15.290 us/op 1.80
phase0 processRegistryUpdates - 250000 badcase_full_deposits 523.37 us/op 528.00 us/op 0.99
phase0 processRegistryUpdates - 250000 worstcase 0.5 256.24 ms/op 258.91 ms/op 0.99
altair processRewardsAndPenalties - 250000 normalcase 147.29 ms/op 89.245 ms/op 1.65
altair processRewardsAndPenalties - 250000 worstcase 89.697 ms/op 143.63 ms/op 0.62
phase0 getAttestationDeltas - 250000 normalcase 16.478 ms/op 16.855 ms/op 0.98
phase0 getAttestationDeltas - 250000 worstcase 16.707 ms/op 16.709 ms/op 1.00
phase0 processSlashings - 250000 worstcase 6.6775 ms/op 6.4334 ms/op 1.04
altair processSyncCommitteeUpdates - 250000 352.08 ms/op 342.81 ms/op 1.03
BeaconState.hashTreeRoot - No change 815.00 ns/op 728.00 ns/op 1.12
BeaconState.hashTreeRoot - 1 full validator 80.554 us/op 74.692 us/op 1.08
BeaconState.hashTreeRoot - 32 full validator 847.27 us/op 761.13 us/op 1.11
BeaconState.hashTreeRoot - 512 full validator 14.397 ms/op 7.3908 ms/op 1.95
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 106.20 us/op 96.875 us/op 1.10
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.6468 ms/op 1.4469 ms/op 1.14
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 20.665 ms/op 18.799 ms/op 1.10
BeaconState.hashTreeRoot - 1 balances 79.209 us/op 72.509 us/op 1.09
BeaconState.hashTreeRoot - 32 balances 672.36 us/op 780.81 us/op 0.86
BeaconState.hashTreeRoot - 512 balances 6.6290 ms/op 6.2153 ms/op 1.07
BeaconState.hashTreeRoot - 250000 balances 112.06 ms/op 107.41 ms/op 1.04
aggregationBits - 2048 els - zipIndexesInBitList 42.561 us/op 40.656 us/op 1.05
regular array get 100000 times 58.818 us/op 80.816 us/op 0.73
wrappedArray get 100000 times 57.961 us/op 80.889 us/op 0.72
arrayWithProxy get 100000 times 35.912 ms/op 35.446 ms/op 1.01
ssz.Root.equals 651.00 ns/op 618.00 ns/op 1.05
byteArrayEquals 625.00 ns/op 625.00 ns/op 1.00
shuffle list - 16384 els 12.672 ms/op 13.305 ms/op 0.95
shuffle list - 250000 els 179.89 ms/op 196.16 ms/op 0.92
processSlot - 1 slots 18.966 us/op 15.903 us/op 1.19
processSlot - 32 slots 2.7837 ms/op 2.1970 ms/op 1.27
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 382.38 us/op 1.0794 ms/op 0.35
getCommitteeAssignments - req 1 vs - 250000 vc 5.5967 ms/op 6.4238 ms/op 0.87
getCommitteeAssignments - req 100 vs - 250000 vc 7.9376 ms/op 8.8131 ms/op 0.90
getCommitteeAssignments - req 1000 vs - 250000 vc 8.5721 ms/op 9.4898 ms/op 0.90
computeProposers - vc 250000 20.849 ms/op 19.823 ms/op 1.05
computeEpochShuffling - vc 250000 183.87 ms/op 201.14 ms/op 0.91
getNextSyncCommittee - vc 250000 347.98 ms/op 328.48 ms/op 1.06
pass gossip attestations to forkchoice per slot 3.8015 ms/op 3.8641 ms/op 0.98
computeDeltas 4.3043 ms/op 3.6728 ms/op 1.17
computeProposerBoostScoreFromBalances 891.90 us/op 1.0913 ms/op 0.82
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.3586 ms/op 2.6882 ms/op 0.88
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 97.983 us/op 106.62 us/op 0.92
BLS verify - blst-native 2.7031 ms/op 2.3056 ms/op 1.17
BLS verifyMultipleSignatures 3 - blst-native 5.6085 ms/op 4.4908 ms/op 1.25
BLS verifyMultipleSignatures 8 - blst-native 12.177 ms/op 9.8267 ms/op 1.24
BLS verifyMultipleSignatures 32 - blst-native 43.704 ms/op 35.510 ms/op 1.23
BLS aggregatePubkeys 32 - blst-native 59.781 us/op 47.848 us/op 1.25
BLS aggregatePubkeys 128 - blst-native 236.43 us/op 183.09 us/op 1.29
getAttestationsForBlock 69.780 ms/op 84.264 ms/op 0.83
isKnown best case - 1 super set check 544.00 ns/op 535.00 ns/op 1.02
isKnown normal case - 2 super set checks 547.00 ns/op 516.00 ns/op 1.06
isKnown worse case - 16 super set checks 514.00 ns/op 513.00 ns/op 1.00
CheckpointStateCache - add get delete 14.367 us/op 13.316 us/op 1.08
validate gossip signedAggregateAndProof - struct 6.2887 ms/op 5.0583 ms/op 1.24
validate gossip attestation - struct 2.9639 ms/op 2.4199 ms/op 1.22
altair verifyImport mainnet_s3766816:31 8.6267 s/op 7.5122 s/op 1.15
pickEth1Vote - no votes 2.6327 ms/op 2.4421 ms/op 1.08
pickEth1Vote - max votes 27.580 ms/op 25.014 ms/op 1.10
pickEth1Vote - Eth1Data hashTreeRoot value x2048 16.265 ms/op 14.015 ms/op 1.16
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 25.861 ms/op 24.208 ms/op 1.07
pickEth1Vote - Eth1Data fastSerialize value x2048 1.8584 ms/op 1.8397 ms/op 1.01
pickEth1Vote - Eth1Data fastSerialize tree x2048 19.826 ms/op 16.704 ms/op 1.19
bytes32 toHexString 1.4050 us/op 1.3580 us/op 1.03
bytes32 Buffer.toString(hex) 859.00 ns/op 840.00 ns/op 1.02
bytes32 Buffer.toString(hex) from Uint8Array 1.1620 us/op 1.0960 us/op 1.06
bytes32 Buffer.toString(hex) + 0x 902.00 ns/op 840.00 ns/op 1.07
Object access 1 prop 0.45800 ns/op 0.47900 ns/op 0.96
Map access 1 prop 0.34200 ns/op 0.35300 ns/op 0.97
Object get x1000 17.196 ns/op 19.868 ns/op 0.87
Map get x1000 1.1270 ns/op 1.1620 ns/op 0.97
Object set x1000 124.59 ns/op 137.83 ns/op 0.90
Map set x1000 87.159 ns/op 87.484 ns/op 1.00
Return object 10000 times 0.43000 ns/op 0.44820 ns/op 0.96
Throw Error 10000 times 7.1348 us/op 7.1364 us/op 1.00
enrSubnets - fastDeserialize 64 bits 3.4000 us/op 3.2900 us/op 1.03
enrSubnets - ssz BitVector 64 bits 908.00 ns/op 955.00 ns/op 0.95
enrSubnets - fastDeserialize 4 bits 480.00 ns/op 510.00 ns/op 0.94
enrSubnets - ssz BitVector 4 bits 913.00 ns/op 933.00 ns/op 0.98
prioritizePeers score -10:0 att 32-0.1 sync 2-0 119.59 us/op 114.46 us/op 1.04
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 161.07 us/op 144.76 us/op 1.11
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 287.77 us/op 262.94 us/op 1.09
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 619.57 us/op 545.33 us/op 1.14
prioritizePeers score 0:0 att 64-1 sync 4-1 639.68 us/op 546.74 us/op 1.17
RateTracker 1000000 limit, 1 obj count per request 217.24 ns/op 225.63 ns/op 0.96
RateTracker 1000000 limit, 2 obj count per request 163.54 ns/op 167.09 ns/op 0.98
RateTracker 1000000 limit, 4 obj count per request 136.87 ns/op 140.17 ns/op 0.98
RateTracker 1000000 limit, 8 obj count per request 124.65 ns/op 128.80 ns/op 0.97
RateTracker with prune 5.9780 us/op 5.1610 us/op 1.16
array of 16000 items push then shift 5.2761 us/op 3.6891 us/op 1.43
LinkedList of 16000 items push then shift 28.626 ns/op 28.388 ns/op 1.01
array of 16000 items push then pop 261.08 ns/op 279.81 ns/op 0.93
LinkedList of 16000 items push then pop 24.177 ns/op 24.358 ns/op 0.99
array of 24000 items push then shift 8.2051 us/op 5.4199 us/op 1.51
LinkedList of 24000 items push then shift 28.645 ns/op 29.430 ns/op 0.97
array of 24000 items push then pop 232.49 ns/op 238.48 ns/op 0.97
LinkedList of 24000 items push then pop 24.339 ns/op 24.667 ns/op 0.99
intersect bitArray bitLen 8 12.949 ns/op 14.077 ns/op 0.92
intersect array and set length 8 214.54 ns/op 191.70 ns/op 1.12
intersect bitArray bitLen 128 71.635 ns/op 73.177 ns/op 0.98
intersect array and set length 128 2.5176 us/op 2.6553 us/op 0.95

by benchmarkbot/action

@wemeetagain
Copy link
Member

Need to reapply the no-extraneous-dependencies rule exception here https://github.com/ChainSafe/lodestar/blob/unstable/packages/api/src/utils/server/types.ts#L1-L2

Looks like it got moved down a line recently.

yarn.lock Outdated
eventsource "^1.1.0"
qs "^6.10.1"

"@chainsafe/lodestar-beacon-state-transition@^0.37.0":
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey what the hell is going on with this constants diff, can you investigate please?

Copy link
Contributor

Choose a reason for hiding this comment

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

@dadepo can you remove the unwanted yarn.lock diff and open an issue about it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It has been removed

@dadepo dadepo force-pushed the dadepo/return-fastify-to-dev-dep branch from ccc2978 to a4c0263 Compare June 17, 2022 09:50
@dadepo dadepo marked this pull request as ready for review June 17, 2022 10:16
@dadepo dadepo requested a review from a team as a code owner June 17, 2022 10:16
@wemeetagain wemeetagain merged commit 83aa2cc into unstable Jun 17, 2022
@wemeetagain wemeetagain deleted the dadepo/return-fastify-to-dev-dep branch June 17, 2022 17:27
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.

Move fastify to devDependency in lodestar-api
3 participants