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

Update to libp2p-mplex 0.10.5 #3489

Merged
merged 1 commit into from
Dec 7, 2021
Merged

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Dec 7, 2021

Motivation

  • There is a performance issue in v0.10.4 that make libp2p.mplex decode() expensive

Description

  • The issue is fixed in libp2p-mplex 0.10.5

Closes #3467

@codeclimate
Copy link

codeclimate bot commented Dec 7, 2021

Code Climate has analyzed commit 6232980 and detected 0 issues on this pull request.

View more on Code Climate.

@codecov
Copy link

codecov bot commented Dec 7, 2021

Codecov Report

Merging #3489 (4713f20) into master (e4502df) will not change coverage.
The diff coverage is n/a.

❗ Current head 4713f20 differs from pull request most recent head 6232980. Consider uploading reports for the commit 6232980 to get more accurate results

@@           Coverage Diff           @@
##           master    #3489   +/-   ##
=======================================
  Coverage   37.91%   37.91%           
=======================================
  Files         308      308           
  Lines        8133     8133           
  Branches     1250     1250           
=======================================
  Hits         3084     3084           
  Misses       4899     4899           
  Partials      150      150           

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2021

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 4713f20 Previous: fe09d92 Ratio
BeaconState.hashTreeRoot - No change 582.00 ns/op 775.00 ns/op 0.75
BeaconState.hashTreeRoot - 1 full validator 86.871 us/op 103.70 us/op 0.84
BeaconState.hashTreeRoot - 32 full validator 1.0983 ms/op 1.6427 ms/op 0.67
BeaconState.hashTreeRoot - 512 full validator 15.310 ms/op 17.193 ms/op 0.89
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 75.641 us/op 99.555 us/op 0.76
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3200 ms/op 1.6137 ms/op 0.82
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 17.956 ms/op 20.484 ms/op 0.88
BeaconState.hashTreeRoot - 1 balances 58.777 us/op 72.872 us/op 0.81
BeaconState.hashTreeRoot - 32 balances 464.95 us/op 606.58 us/op 0.77
BeaconState.hashTreeRoot - 512 balances 4.4681 ms/op 5.3637 ms/op 0.83
BeaconState.hashTreeRoot - 250000 balances 85.812 ms/op 95.910 ms/op 0.89
processSlot - 1 slots 37.631 us/op 47.756 us/op 0.79
processSlot - 32 slots 2.0736 ms/op 2.4633 ms/op 0.84
getCommitteeAssignments - req 1 vs - 250000 vc 5.2589 ms/op 5.2045 ms/op 1.01
getCommitteeAssignments - req 100 vs - 250000 vc 8.2606 ms/op 7.3312 ms/op 1.13
getCommitteeAssignments - req 1000 vs - 250000 vc 8.1891 ms/op 7.9173 ms/op 1.03
computeProposers - vc 250000 20.304 ms/op 23.531 ms/op 0.86
computeEpochShuffling - vc 250000 195.77 ms/op 206.56 ms/op 0.95
getNextSyncCommittee - vc 250000 328.50 ms/op 392.21 ms/op 0.84
altair processAttestation - 250000 vs - 7PWei normalcase 34.165 ms/op 45.869 ms/op 0.74
altair processAttestation - 250000 vs - 7PWei worstcase 40.836 ms/op 43.480 ms/op 0.94
altair processAttestation - setStatus - 1/6 committees join 8.9159 ms/op 10.579 ms/op 0.84
altair processAttestation - setStatus - 1/3 committees join 18.228 ms/op 23.751 ms/op 0.77
altair processAttestation - setStatus - 1/2 committees join 28.883 ms/op 34.909 ms/op 0.83
altair processAttestation - setStatus - 2/3 committees join 38.547 ms/op 44.717 ms/op 0.86
altair processAttestation - setStatus - 4/5 committees join 47.210 ms/op 51.864 ms/op 0.91
altair processAttestation - setStatus - 100% committees join 57.878 ms/op 65.470 ms/op 0.88
altair processAttestation - updateEpochParticipants - 1/6 committees join 9.7023 ms/op 11.126 ms/op 0.87
altair processAttestation - updateEpochParticipants - 1/3 committees join 20.131 ms/op 22.598 ms/op 0.89
altair processAttestation - updateEpochParticipants - 1/2 committees join 26.531 ms/op 30.379 ms/op 0.87
altair processAttestation - updateEpochParticipants - 2/3 committees join 24.829 ms/op 27.119 ms/op 0.92
altair processAttestation - updateEpochParticipants - 4/5 committees join 26.127 ms/op 28.725 ms/op 0.91
altair processAttestation - updateEpochParticipants - 100% committees join 27.825 ms/op 29.833 ms/op 0.93
altair processAttestation - updateAllStatus 18.942 ms/op 21.098 ms/op 0.90
altair processBlock - 250000 vs - 7PWei normalcase 40.820 ms/op 48.522 ms/op 0.84
altair processBlock - 250000 vs - 7PWei worstcase 108.84 ms/op 146.42 ms/op 0.74
altair processEpoch - mainnet_e81889 926.97 ms/op 986.10 ms/op 0.94
mainnet_e81889 - altair beforeProcessEpoch 260.98 ms/op 290.52 ms/op 0.90
mainnet_e81889 - altair processJustificationAndFinalization 48.587 us/op 106.60 us/op 0.46
mainnet_e81889 - altair processInactivityUpdates 17.768 ms/op 18.274 ms/op 0.97
mainnet_e81889 - altair processRewardsAndPenalties 113.08 ms/op 113.14 ms/op 1.00
mainnet_e81889 - altair processRegistryUpdates 5.3060 us/op 17.768 us/op 0.30
mainnet_e81889 - altair processSlashings 1.0540 us/op 4.9120 us/op 0.21
mainnet_e81889 - altair processEth1DataReset 988.00 ns/op 5.7540 us/op 0.17
mainnet_e81889 - altair processEffectiveBalanceUpdates 11.560 ms/op 12.822 ms/op 0.90
mainnet_e81889 - altair processSlashingsReset 7.4540 us/op 32.802 us/op 0.23
mainnet_e81889 - altair processRandaoMixesReset 10.889 us/op 38.194 us/op 0.29
mainnet_e81889 - altair processHistoricalRootsUpdate 1.2850 us/op 7.0010 us/op 0.18
mainnet_e81889 - altair processParticipationFlagUpdates 137.05 ms/op 154.11 ms/op 0.89
mainnet_e81889 - altair processSyncCommitteeUpdates 1.0660 us/op 4.8140 us/op 0.22
mainnet_e81889 - altair afterProcessEpoch 217.94 ms/op 231.22 ms/op 0.94
altair processInactivityUpdates - 250000 normalcase 61.387 ms/op 82.045 ms/op 0.75
altair processInactivityUpdates - 250000 worstcase 61.746 ms/op 79.871 ms/op 0.77
altair processParticipationFlagUpdates - 250000 anycase 85.727 ms/op 116.31 ms/op 0.74
altair processRewardsAndPenalties - 250000 normalcase 114.56 ms/op 141.87 ms/op 0.81
altair processRewardsAndPenalties - 250000 worstcase 128.38 ms/op 122.34 ms/op 1.05
altair processSyncCommitteeUpdates - 250000 352.71 ms/op 446.72 ms/op 0.79
Tree 40 250000 create 468.40 ms/op 586.95 ms/op 0.80
Tree 40 250000 get(125000) 328.53 ns/op 344.29 ns/op 0.95
Tree 40 250000 set(125000) 1.4351 us/op 2.0616 us/op 0.70
Tree 40 250000 toArray() 39.489 ms/op 46.415 ms/op 0.85
Tree 40 250000 iterate all - toArray() + loop 38.940 ms/op 50.724 ms/op 0.77
Tree 40 250000 iterate all - get(i) 119.21 ms/op 129.40 ms/op 0.92
MutableVector 250000 create 23.893 ms/op 26.763 ms/op 0.89
MutableVector 250000 get(125000) 13.552 ns/op 14.586 ns/op 0.93
MutableVector 250000 set(125000) 511.48 ns/op 642.78 ns/op 0.80
MutableVector 250000 toArray() 8.7852 ms/op 9.1833 ms/op 0.96
MutableVector 250000 iterate all - toArray() + loop 9.0105 ms/op 9.5273 ms/op 0.95
MutableVector 250000 iterate all - get(i) 3.7078 ms/op 4.4760 ms/op 0.83
Array 250000 create 5.5628 ms/op 5.7407 ms/op 0.97
Array 250000 clone - spread 2.1813 ms/op 2.2005 ms/op 0.99
Array 250000 get(125000) 1.0220 ns/op 1.1770 ns/op 0.87
Array 250000 set(125000) 1.0220 ns/op 1.2170 ns/op 0.84
Array 250000 iterate all - loop 168.80 us/op 149.61 us/op 1.13
aggregationBits - 2048 els - readonlyValues 234.43 us/op 244.22 us/op 0.96
aggregationBits - 2048 els - zipIndexesInBitList 39.970 us/op 46.107 us/op 0.87
regular array get 100000 times 67.419 us/op 60.480 us/op 1.11
wrappedArray get 100000 times 67.446 us/op 61.242 us/op 1.10
arrayWithProxy get 100000 times 28.886 ms/op 34.738 ms/op 0.83
ssz.Root.equals 1.2010 us/op 1.4370 us/op 0.84
ssz.Root.equals with valueOf() 1.3980 us/op 1.6080 us/op 0.87
byteArrayEquals with valueOf() 1.4160 us/op 1.6170 us/op 0.88
phase0 processBlock - 250000 vs - 7PWei normalcase 10.385 ms/op 13.783 ms/op 0.75
phase0 processBlock - 250000 vs - 7PWei worstcase 72.694 ms/op 95.403 ms/op 0.76
phase0 afterProcessEpoch - 250000 vs - 7PWei 204.02 ms/op 238.20 ms/op 0.86
phase0 beforeProcessEpoch - 250000 vs - 7PWei 559.17 ms/op 748.66 ms/op 0.75
phase0 processEpoch - mainnet_e58758 738.28 ms/op 928.61 ms/op 0.80
mainnet_e58758 - phase0 beforeProcessEpoch 447.20 ms/op 571.72 ms/op 0.78
mainnet_e58758 - phase0 processJustificationAndFinalization 44.851 us/op 110.75 us/op 0.40
mainnet_e58758 - phase0 processRewardsAndPenalties 110.48 ms/op 86.330 ms/op 1.28
mainnet_e58758 - phase0 processRegistryUpdates 32.374 us/op 74.404 us/op 0.44
mainnet_e58758 - phase0 processSlashings 1.0640 us/op 6.6140 us/op 0.16
mainnet_e58758 - phase0 processEth1DataReset 1.0770 us/op 5.6260 us/op 0.19
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 9.9775 ms/op 11.167 ms/op 0.89
mainnet_e58758 - phase0 processSlashingsReset 6.8130 us/op 27.609 us/op 0.25
mainnet_e58758 - phase0 processRandaoMixesReset 13.678 us/op 37.467 us/op 0.37
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.2090 us/op 6.9630 us/op 0.17
mainnet_e58758 - phase0 processParticipationRecordUpdates 7.4930 us/op 26.382 us/op 0.28
mainnet_e58758 - phase0 afterProcessEpoch 178.48 ms/op 204.09 ms/op 0.87
phase0 processEffectiveBalanceUpdates - 250000 normalcase 11.147 ms/op 12.152 ms/op 0.92
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.1201 s/op 1.3158 s/op 0.85
phase0 processRegistryUpdates - 250000 normalcase 31.285 us/op 75.424 us/op 0.41
phase0 processRegistryUpdates - 250000 badcase_full_deposits 2.5471 ms/op 3.3028 ms/op 0.77
phase0 processRegistryUpdates - 250000 worstcase 0.5 1.3959 s/op 1.9654 s/op 0.71
phase0 getAttestationDeltas - 250000 normalcase 34.351 ms/op 42.887 ms/op 0.80
phase0 getAttestationDeltas - 250000 worstcase 42.792 ms/op 41.037 ms/op 1.04
phase0 processSlashings - 250000 worstcase 28.166 ms/op 32.999 ms/op 0.85
shuffle list - 16384 els 12.481 ms/op 13.906 ms/op 0.90
shuffle list - 250000 els 180.05 ms/op 199.54 ms/op 0.90
getEffectiveBalances - 250000 vs - 7PWei 10.414 ms/op 12.719 ms/op 0.82
computeDeltas 3.5101 ms/op 3.8498 ms/op 0.91
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.3136 ms/op 2.6252 ms/op 0.88
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 679.67 us/op 791.61 us/op 0.86
BLS verify - blst-native 1.8580 ms/op 2.2387 ms/op 0.83
BLS verifyMultipleSignatures 3 - blst-native 3.8138 ms/op 4.7300 ms/op 0.81
BLS verifyMultipleSignatures 8 - blst-native 8.2353 ms/op 10.696 ms/op 0.77
BLS verifyMultipleSignatures 32 - blst-native 29.850 ms/op 37.918 ms/op 0.79
BLS aggregatePubkeys 32 - blst-native 39.267 us/op 48.942 us/op 0.80
BLS aggregatePubkeys 128 - blst-native 153.93 us/op 189.24 us/op 0.81
getAttestationsForBlock 76.912 ms/op 90.335 ms/op 0.85
CheckpointStateCache - add get delete 15.683 us/op 18.965 us/op 0.83
validate gossip signedAggregateAndProof - struct 4.4537 ms/op 5.6531 ms/op 0.79
validate gossip signedAggregateAndProof - treeBacked 4.4754 ms/op 5.5294 ms/op 0.81
validate gossip attestation - struct 2.1096 ms/op 2.6025 ms/op 0.81
validate gossip attestation - treeBacked 2.1005 ms/op 2.6624 ms/op 0.79
Object access 1 prop 0.35800 ns/op 0.42800 ns/op 0.84
Map access 1 prop 0.28500 ns/op 0.35400 ns/op 0.81
Object get x1000 18.797 ns/op 16.516 ns/op 1.14
Map get x1000 0.97800 ns/op 0.96300 ns/op 1.02
Object set x1000 119.48 ns/op 122.25 ns/op 0.98
Map set x1000 72.562 ns/op 83.425 ns/op 0.87
Return object 10000 times 0.37350 ns/op 0.44510 ns/op 0.84
Throw Error 10000 times 6.0140 us/op 7.0322 us/op 0.86

by benchmarkbot/action

@wemeetagain wemeetagain merged commit 3e30102 into master Dec 7, 2021
@wemeetagain wemeetagain deleted the tuyen/update-libp2p-mplex branch December 7, 2021 14:34
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.

libp2p-mplex decode performance issue
2 participants