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: persist network thread profile #5628

Merged
merged 7 commits into from
Jun 13, 2023

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Jun 12, 2023

Motivation

  • We want to take profile of network thread without promise tracking

Description

  • Use node:inspector module to persist network thread profile

part of #5604

@github-actions
Copy link
Contributor

github-actions bot commented Jun 12, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: a21c50b Previous: c0115b0 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 930.45 us/op 886.07 us/op 1.05
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 46.551 us/op 45.218 us/op 1.03
BLS verify - blst-native 1.2080 ms/op 1.2209 ms/op 0.99
BLS verifyMultipleSignatures 3 - blst-native 2.4633 ms/op 2.4840 ms/op 0.99
BLS verifyMultipleSignatures 8 - blst-native 5.2828 ms/op 5.3430 ms/op 0.99
BLS verifyMultipleSignatures 32 - blst-native 19.105 ms/op 19.430 ms/op 0.98
BLS aggregatePubkeys 32 - blst-native 25.546 us/op 25.769 us/op 0.99
BLS aggregatePubkeys 128 - blst-native 100.02 us/op 100.59 us/op 0.99
getAttestationsForBlock 54.378 ms/op 58.187 ms/op 0.93
isKnown best case - 1 super set check 255.00 ns/op 252.00 ns/op 1.01
isKnown normal case - 2 super set checks 251.00 ns/op 250.00 ns/op 1.00
isKnown worse case - 16 super set checks 243.00 ns/op 250.00 ns/op 0.97
CheckpointStateCache - add get delete 4.9940 us/op 5.3050 us/op 0.94
validate gossip signedAggregateAndProof - struct 2.7712 ms/op 2.8098 ms/op 0.99
validate gossip attestation - struct 1.3184 ms/op 1.3286 ms/op 0.99
pickEth1Vote - no votes 1.2884 ms/op 1.2866 ms/op 1.00
pickEth1Vote - max votes 10.336 ms/op 9.3586 ms/op 1.10
pickEth1Vote - Eth1Data hashTreeRoot value x2048 9.1893 ms/op 8.8657 ms/op 1.04
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 14.647 ms/op 14.510 ms/op 1.01
pickEth1Vote - Eth1Data fastSerialize value x2048 696.35 us/op 634.27 us/op 1.10
pickEth1Vote - Eth1Data fastSerialize tree x2048 6.0854 ms/op 4.8469 ms/op 1.26
bytes32 toHexString 550.00 ns/op 520.00 ns/op 1.06
bytes32 Buffer.toString(hex) 396.00 ns/op 385.00 ns/op 1.03
bytes32 Buffer.toString(hex) from Uint8Array 585.00 ns/op 564.00 ns/op 1.04
bytes32 Buffer.toString(hex) + 0x 369.00 ns/op 362.00 ns/op 1.02
Object access 1 prop 0.17200 ns/op 0.17700 ns/op 0.97
Map access 1 prop 0.16300 ns/op 0.15900 ns/op 1.03
Object get x1000 6.6690 ns/op 7.0510 ns/op 0.95
Map get x1000 0.59700 ns/op 0.62100 ns/op 0.96
Object set x1000 56.870 ns/op 52.134 ns/op 1.09
Map set x1000 47.758 ns/op 43.692 ns/op 1.09
Return object 10000 times 0.24070 ns/op 0.23360 ns/op 1.03
Throw Error 10000 times 4.3058 us/op 4.2826 us/op 1.01
fastMsgIdFn sha256 / 200 bytes 3.5210 us/op 3.4550 us/op 1.02
fastMsgIdFn h32 xxhash / 200 bytes 288.00 ns/op 302.00 ns/op 0.95
fastMsgIdFn h64 xxhash / 200 bytes 424.00 ns/op 401.00 ns/op 1.06
fastMsgIdFn sha256 / 1000 bytes 11.657 us/op 11.731 us/op 0.99
fastMsgIdFn h32 xxhash / 1000 bytes 432.00 ns/op 412.00 ns/op 1.05
fastMsgIdFn h64 xxhash / 1000 bytes 527.00 ns/op 487.00 ns/op 1.08
fastMsgIdFn sha256 / 10000 bytes 103.76 us/op 101.41 us/op 1.02
fastMsgIdFn h32 xxhash / 10000 bytes 1.9810 us/op 1.9050 us/op 1.04
fastMsgIdFn h64 xxhash / 10000 bytes 1.4650 us/op 1.4000 us/op 1.05
enrSubnets - fastDeserialize 64 bits 1.4160 us/op 1.2880 us/op 1.10
enrSubnets - ssz BitVector 64 bits 548.00 ns/op 547.00 ns/op 1.00
enrSubnets - fastDeserialize 4 bits 189.00 ns/op 187.00 ns/op 1.01
enrSubnets - ssz BitVector 4 bits 558.00 ns/op 567.00 ns/op 0.98
prioritizePeers score -10:0 att 32-0.1 sync 2-0 115.85 us/op 105.98 us/op 1.09
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 155.88 us/op 139.98 us/op 1.11
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 192.08 us/op 176.00 us/op 1.09
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 350.18 us/op 347.82 us/op 1.01
prioritizePeers score 0:0 att 64-1 sync 4-1 417.46 us/op 371.27 us/op 1.12
array of 16000 items push then shift 1.6652 us/op 1.6077 us/op 1.04
LinkedList of 16000 items push then shift 8.9860 ns/op 8.7670 ns/op 1.02
array of 16000 items push then pop 114.73 ns/op 92.529 ns/op 1.24
LinkedList of 16000 items push then pop 8.8590 ns/op 8.7240 ns/op 1.02
array of 24000 items push then shift 2.5031 us/op 2.3617 us/op 1.06
LinkedList of 24000 items push then shift 9.0380 ns/op 8.8700 ns/op 1.02
array of 24000 items push then pop 78.437 ns/op 76.429 ns/op 1.03
LinkedList of 24000 items push then pop 8.6990 ns/op 8.5290 ns/op 1.02
intersect bitArray bitLen 8 13.386 ns/op 13.238 ns/op 1.01
intersect array and set length 8 80.010 ns/op 78.784 ns/op 1.02
intersect bitArray bitLen 128 44.069 ns/op 46.195 ns/op 0.95
intersect array and set length 128 1.1269 us/op 1.0655 us/op 1.06
Buffer.concat 32 items 2.8940 us/op 2.9260 us/op 0.99
Uint8Array.set 32 items 2.8610 us/op 2.1360 us/op 1.34
transfer serialized Status (84 B) 2.2570 us/op 2.0220 us/op 1.12
copy serialized Status (84 B) 1.8570 us/op 1.7610 us/op 1.05
transfer serialized SignedVoluntaryExit (112 B) 2.2930 us/op 2.3320 us/op 0.98
copy serialized SignedVoluntaryExit (112 B) 1.9120 us/op 1.9640 us/op 0.97
transfer serialized ProposerSlashing (416 B) 2.6120 us/op 3.0940 us/op 0.84
copy serialized ProposerSlashing (416 B) 2.1350 us/op 3.2500 us/op 0.66
transfer serialized Attestation (485 B) 2.6680 us/op 3.2800 us/op 0.81
copy serialized Attestation (485 B) 2.6470 us/op 2.0180 us/op 1.31
transfer serialized AttesterSlashing (33232 B) 3.1080 us/op 2.3810 us/op 1.31
copy serialized AttesterSlashing (33232 B) 6.2490 us/op 5.2030 us/op 1.20
transfer serialized Small SignedBeaconBlock (128000 B) 3.0650 us/op 2.7770 us/op 1.10
copy serialized Small SignedBeaconBlock (128000 B) 13.762 us/op 13.130 us/op 1.05
transfer serialized Avg SignedBeaconBlock (200000 B) 3.2950 us/op 3.0950 us/op 1.06
copy serialized Avg SignedBeaconBlock (200000 B) 64.431 us/op 18.658 us/op 3.45
transfer serialized BlobsSidecar (524380 B) 3.2680 us/op 3.0650 us/op 1.07
copy serialized BlobsSidecar (524380 B) 187.68 us/op 138.30 us/op 1.36
transfer serialized Big SignedBeaconBlock (1000000 B) 3.4200 us/op 3.1040 us/op 1.10
copy serialized Big SignedBeaconBlock (1000000 B) 239.02 us/op 290.41 us/op 0.82
pass gossip attestations to forkchoice per slot 2.6589 ms/op 2.6563 ms/op 1.00
forkChoice updateHead vc 100000 bc 64 eq 0 2.0977 ms/op 2.1123 ms/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 0 11.327 ms/op 12.141 ms/op 0.93
forkChoice updateHead vc 1000000 bc 64 eq 0 22.038 ms/op 24.192 ms/op 0.91
forkChoice updateHead vc 600000 bc 320 eq 0 16.251 ms/op 17.801 ms/op 0.91
forkChoice updateHead vc 600000 bc 1200 eq 0 82.076 ms/op 85.492 ms/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 1000 20.829 ms/op 21.300 ms/op 0.98
forkChoice updateHead vc 600000 bc 64 eq 10000 22.701 ms/op 22.882 ms/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 300000 30.903 ms/op 31.727 ms/op 0.97
computeDeltas 3.6839 ms/op 3.3991 ms/op 1.08
computeProposerBoostScoreFromBalances 1.8005 ms/op 1.8470 ms/op 0.97
altair processAttestation - 250000 vs - 7PWei normalcase 2.6480 ms/op 2.9331 ms/op 0.90
altair processAttestation - 250000 vs - 7PWei worstcase 3.8177 ms/op 4.9194 ms/op 0.78
altair processAttestation - setStatus - 1/6 committees join 140.22 us/op 142.95 us/op 0.98
altair processAttestation - setStatus - 1/3 committees join 277.51 us/op 280.34 us/op 0.99
altair processAttestation - setStatus - 1/2 committees join 373.33 us/op 377.89 us/op 0.99
altair processAttestation - setStatus - 2/3 committees join 462.91 us/op 473.71 us/op 0.98
altair processAttestation - setStatus - 4/5 committees join 649.24 us/op 653.21 us/op 0.99
altair processAttestation - setStatus - 100% committees join 760.79 us/op 766.27 us/op 0.99
altair processBlock - 250000 vs - 7PWei normalcase 18.327 ms/op 18.574 ms/op 0.99
altair processBlock - 250000 vs - 7PWei normalcase hashState 24.349 ms/op 25.929 ms/op 0.94
altair processBlock - 250000 vs - 7PWei worstcase 49.402 ms/op 52.597 ms/op 0.94
altair processBlock - 250000 vs - 7PWei worstcase hashState 65.623 ms/op 70.661 ms/op 0.93
phase0 processBlock - 250000 vs - 7PWei normalcase 2.5117 ms/op 2.8071 ms/op 0.89
phase0 processBlock - 250000 vs - 7PWei worstcase 31.635 ms/op 32.530 ms/op 0.97
altair processEth1Data - 250000 vs - 7PWei normalcase 537.91 us/op 517.52 us/op 1.04
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 9.2310 us/op 13.028 us/op 0.71
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 29.540 us/op 29.891 us/op 0.99
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 12.600 us/op 13.600 us/op 0.93
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 9.0190 us/op 10.648 us/op 0.85
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 111.55 us/op 121.47 us/op 0.92
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 684.40 us/op 717.25 us/op 0.95
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 907.82 us/op 1.0599 ms/op 0.86
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 921.41 us/op 946.22 us/op 0.97
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.6322 ms/op 2.7542 ms/op 0.96
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.7323 ms/op 1.7660 ms/op 0.98
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.8398 ms/op 4.2781 ms/op 1.13
Tree 40 250000 create 442.93 ms/op 332.76 ms/op 1.33
Tree 40 250000 get(125000) 206.71 ns/op 193.54 ns/op 1.07
Tree 40 250000 set(125000) 1.2150 us/op 987.51 ns/op 1.23
Tree 40 250000 toArray() 23.223 ms/op 20.803 ms/op 1.12
Tree 40 250000 iterate all - toArray() + loop 23.813 ms/op 21.765 ms/op 1.09
Tree 40 250000 iterate all - get(i) 78.342 ms/op 73.960 ms/op 1.06
MutableVector 250000 create 11.756 ms/op 12.982 ms/op 0.91
MutableVector 250000 get(125000) 6.4930 ns/op 6.5140 ns/op 1.00
MutableVector 250000 set(125000) 415.26 ns/op 253.91 ns/op 1.64
MutableVector 250000 toArray() 4.0848 ms/op 3.1025 ms/op 1.32
MutableVector 250000 iterate all - toArray() + loop 4.2888 ms/op 3.1181 ms/op 1.38
MutableVector 250000 iterate all - get(i) 1.6265 ms/op 1.5485 ms/op 1.05
Array 250000 create 4.0477 ms/op 2.7152 ms/op 1.49
Array 250000 clone - spread 1.2222 ms/op 1.1000 ms/op 1.11
Array 250000 get(125000) 0.60000 ns/op 0.56300 ns/op 1.07
Array 250000 set(125000) 0.76800 ns/op 0.64700 ns/op 1.19
Array 250000 iterate all - loop 109.16 us/op 88.797 us/op 1.23
effectiveBalanceIncrements clone Uint8Array 300000 43.136 us/op 29.683 us/op 1.45
effectiveBalanceIncrements clone MutableVector 300000 342.00 ns/op 353.00 ns/op 0.97
effectiveBalanceIncrements rw all Uint8Array 300000 169.86 us/op 174.32 us/op 0.97
effectiveBalanceIncrements rw all MutableVector 300000 92.542 ms/op 85.026 ms/op 1.09
phase0 afterProcessEpoch - 250000 vs - 7PWei 117.56 ms/op 118.63 ms/op 0.99
phase0 beforeProcessEpoch - 250000 vs - 7PWei 42.397 ms/op 45.056 ms/op 0.94
altair processEpoch - mainnet_e81889 307.85 ms/op 319.88 ms/op 0.96
mainnet_e81889 - altair beforeProcessEpoch 51.268 ms/op 63.794 ms/op 0.80
mainnet_e81889 - altair processJustificationAndFinalization 18.516 us/op 17.695 us/op 1.05
mainnet_e81889 - altair processInactivityUpdates 5.7631 ms/op 6.0084 ms/op 0.96
mainnet_e81889 - altair processRewardsAndPenalties 71.995 ms/op 64.586 ms/op 1.11
mainnet_e81889 - altair processRegistryUpdates 2.4470 us/op 2.6280 us/op 0.93
mainnet_e81889 - altair processSlashings 626.00 ns/op 499.00 ns/op 1.25
mainnet_e81889 - altair processEth1DataReset 620.00 ns/op 530.00 ns/op 1.17
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2397 ms/op 1.2589 ms/op 0.98
mainnet_e81889 - altair processSlashingsReset 5.1140 us/op 6.6390 us/op 0.77
mainnet_e81889 - altair processRandaoMixesReset 4.7910 us/op 6.4830 us/op 0.74
mainnet_e81889 - altair processHistoricalRootsUpdate 975.00 ns/op 813.00 ns/op 1.20
mainnet_e81889 - altair processParticipationFlagUpdates 3.0240 us/op 2.4200 us/op 1.25
mainnet_e81889 - altair processSyncCommitteeUpdates 918.00 ns/op 588.00 ns/op 1.56
mainnet_e81889 - altair afterProcessEpoch 124.01 ms/op 128.50 ms/op 0.97
phase0 processEpoch - mainnet_e58758 359.05 ms/op 375.33 ms/op 0.96
mainnet_e58758 - phase0 beforeProcessEpoch 133.67 ms/op 141.51 ms/op 0.94
mainnet_e58758 - phase0 processJustificationAndFinalization 16.052 us/op 20.652 us/op 0.78
mainnet_e58758 - phase0 processRewardsAndPenalties 63.492 ms/op 66.607 ms/op 0.95
mainnet_e58758 - phase0 processRegistryUpdates 8.2540 us/op 7.9220 us/op 1.04
mainnet_e58758 - phase0 processSlashings 619.00 ns/op 543.00 ns/op 1.14
mainnet_e58758 - phase0 processEth1DataReset 545.00 ns/op 704.00 ns/op 0.77
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 970.62 us/op 1.1938 ms/op 0.81
mainnet_e58758 - phase0 processSlashingsReset 3.3640 us/op 3.3840 us/op 0.99
mainnet_e58758 - phase0 processRandaoMixesReset 4.8440 us/op 5.4310 us/op 0.89
mainnet_e58758 - phase0 processHistoricalRootsUpdate 680.00 ns/op 661.00 ns/op 1.03
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.3780 us/op 4.1110 us/op 1.06
mainnet_e58758 - phase0 afterProcessEpoch 99.155 ms/op 99.868 ms/op 0.99
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2463 ms/op 1.2603 ms/op 0.99
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.6010 ms/op 1.5797 ms/op 1.01
altair processInactivityUpdates - 250000 normalcase 23.710 ms/op 26.234 ms/op 0.90
altair processInactivityUpdates - 250000 worstcase 28.848 ms/op 25.824 ms/op 1.12
phase0 processRegistryUpdates - 250000 normalcase 7.9770 us/op 7.8290 us/op 1.02
phase0 processRegistryUpdates - 250000 badcase_full_deposits 285.75 us/op 262.81 us/op 1.09
phase0 processRegistryUpdates - 250000 worstcase 0.5 136.57 ms/op 122.30 ms/op 1.12
altair processRewardsAndPenalties - 250000 normalcase 67.192 ms/op 60.124 ms/op 1.12
altair processRewardsAndPenalties - 250000 worstcase 69.557 ms/op 69.009 ms/op 1.01
phase0 getAttestationDeltas - 250000 normalcase 6.7195 ms/op 7.1504 ms/op 0.94
phase0 getAttestationDeltas - 250000 worstcase 6.9388 ms/op 6.8858 ms/op 1.01
phase0 processSlashings - 250000 worstcase 3.5544 ms/op 3.7676 ms/op 0.94
altair processSyncCommitteeUpdates - 250000 176.59 ms/op 187.73 ms/op 0.94
BeaconState.hashTreeRoot - No change 353.00 ns/op 291.00 ns/op 1.21
BeaconState.hashTreeRoot - 1 full validator 56.525 us/op 54.366 us/op 1.04
BeaconState.hashTreeRoot - 32 full validator 564.45 us/op 530.49 us/op 1.06
BeaconState.hashTreeRoot - 512 full validator 5.6972 ms/op 5.1459 ms/op 1.11
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 63.179 us/op 72.163 us/op 0.88
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 915.18 us/op 914.92 us/op 1.00
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 12.024 ms/op 11.686 ms/op 1.03
BeaconState.hashTreeRoot - 1 balances 49.192 us/op 50.114 us/op 0.98
BeaconState.hashTreeRoot - 32 balances 515.29 us/op 492.14 us/op 1.05
BeaconState.hashTreeRoot - 512 balances 4.2105 ms/op 4.5405 ms/op 0.93
BeaconState.hashTreeRoot - 250000 balances 76.003 ms/op 74.842 ms/op 1.02
aggregationBits - 2048 els - zipIndexesInBitList 16.892 us/op 16.626 us/op 1.02
regular array get 100000 times 32.836 us/op 33.552 us/op 0.98
wrappedArray get 100000 times 42.595 us/op 42.050 us/op 1.01
arrayWithProxy get 100000 times 15.635 ms/op 17.057 ms/op 0.92
ssz.Root.equals 552.00 ns/op 637.00 ns/op 0.87
byteArrayEquals 541.00 ns/op 616.00 ns/op 0.88
shuffle list - 16384 els 6.6896 ms/op 7.1379 ms/op 0.94
shuffle list - 250000 els 99.701 ms/op 106.01 ms/op 0.94
processSlot - 1 slots 8.5560 us/op 9.2370 us/op 0.93
processSlot - 32 slots 1.3318 ms/op 1.3796 ms/op 0.97
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 36.855 ms/op 36.628 ms/op 1.01
getCommitteeAssignments - req 1 vs - 250000 vc 2.9079 ms/op 3.0074 ms/op 0.97
getCommitteeAssignments - req 100 vs - 250000 vc 4.1136 ms/op 4.4183 ms/op 0.93
getCommitteeAssignments - req 1000 vs - 250000 vc 4.4205 ms/op 4.6918 ms/op 0.94
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.5300 ns/op 5.3500 ns/op 0.85
state getBlockRootAtSlot - 250000 vs - 7PWei 948.96 ns/op 916.22 ns/op 1.04
computeProposers - vc 250000 10.244 ms/op 11.003 ms/op 0.93
computeEpochShuffling - vc 250000 101.50 ms/op 106.87 ms/op 0.95
getNextSyncCommittee - vc 250000 170.42 ms/op 182.48 ms/op 0.93
computeSigningRoot for AttestationData 13.164 us/op 14.352 us/op 0.92
hash AttestationData serialized data then Buffer.toString(base64) 2.4496 us/op 2.4974 us/op 0.98
toHexString serialized data 1.0698 us/op 1.0806 us/op 0.99
Buffer.toString(base64) 321.31 ns/op 316.12 ns/op 1.02

by benchmarkbot/action

@twoeths twoeths marked this pull request as ready for review June 12, 2023 06:40
@twoeths twoeths requested a review from a team as a code owner June 12, 2023 06:40
@@ -125,6 +129,7 @@ export type Api = {
*/
export const routesData: RoutesData<Api> = {
writeHeapdump: {url: "/eth/v1/lodestar/writeheapdump", method: "POST"},
writeNetworkThreadProfile: {url: "/eth/v1/lodestar/writenetworkthreadprofile", method: "POST"},
Copy link
Contributor

Choose a reason for hiding this comment

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

Every route uses different styles:

Suggested change
writeNetworkThreadProfile: {url: "/eth/v1/lodestar/writenetworkthreadprofile", method: "POST"},
writeNetworkThreadProfile: {url: "/eth/v1/lodestar/write_network_thread_profile", method: "POST"},

I can PR for the rest after merging this PR


session.post("Profiler.enable", () => {
session.post("Profiler.start", async () => {
await sleep(DEFAULT_PROFILE_DURATION);
Copy link
Contributor

@dapplion dapplion Jun 12, 2023

Choose a reason for hiding this comment

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

This should be a optional parameter of the route defaulting to 1 epoch

@@ -147,6 +149,12 @@ const libp2pWorkerApi: NetworkWorkerApi = {
dumpGossipPeerScoreStats: () => core.dumpGossipPeerScoreStats(),
dumpDiscv5KadValues: () => core.dumpDiscv5KadValues(),
dumpMeshPeers: () => core.dumpMeshPeers(),
writeProfile: async (dirpath = ".") => {
const profile = await profileNodeJS();
const filePath = `${dirpath}/network_thread_${new Date().toISOString()}.cpuprofile`;
Copy link
Contributor

@dapplion dapplion Jun 12, 2023

Choose a reason for hiding this comment

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

Use path.join for concatenation, or path.resolve if you need an absolute path

@wemeetagain wemeetagain merged commit 82914a1 into unstable Jun 13, 2023
@wemeetagain wemeetagain deleted the tuyen/network_thread_profile branch June 13, 2023 18:10
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.9.0 🎉

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.

3 participants