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

v1.2.0: High gc time compared to old libp2p #4669

Closed
twoeths opened this issue Oct 19, 2022 · 5 comments
Closed

v1.2.0: High gc time compared to old libp2p #4669

twoeths opened this issue Oct 19, 2022 · 5 comments
Assignees
Labels
prio-high Resolve issues as soon as possible.

Comments

@twoeths
Copy link
Contributor

twoeths commented Oct 19, 2022

Describe the bug

After we migrate libp2p2 0.39.2, the gc percentage is higher

  • On beta v1.2.0 lg1k

Screen Shot 2022-10-19 at 17 27 17

  • On stable v1.1.0 lg1k

Screen Shot 2022-10-19 at 17 24 57

  • On beta v1.2.0 novc

Screen Shot 2022-10-19 at 17 25 33

  • On stable v1.1.0 novc

Screen Shot 2022-10-19 at 17 26 24

This causes a lot of apis to run slower

Screen Shot 2022-10-19 at 17 28 38

1019_feat2_lg1k_1.2.0_rc.0.cpuprofile.zip

This could affect #4660

Expected behavior

Same gc run time to stable

@twoeths
Copy link
Contributor Author

twoeths commented Oct 19, 2022

First effort libp2p/js-libp2p-multistream-select#28

@twoeths twoeths self-assigned this Oct 20, 2022
@twoeths
Copy link
Contributor Author

twoeths commented Oct 20, 2022

every time we call chacha20poly1305 it runs gc because we create temporary Uint8Array instances there

Screen Shot 2022-10-20 at 10 40 32

this could be improved if we implement wasm version of this protocol in #4652

@twoeths twoeths changed the title High gc time compared to old libp2p v1.2.0: High gc time compared to old libp2p Oct 27, 2022
@twoeths twoeths added the prio-high Resolve issues as soon as possible. label Oct 27, 2022
@twoeths
Copy link
Contributor Author

twoeths commented Oct 27, 2022

as-chacha20poly1305 work does not help much, the issue also happens on a novc node (even with a workaround version to use is-ip 4.0.0 in #4689). We need to come up with tests of basic node setup to narrow down the issue.

@twoeths
Copy link
Contributor Author

twoeths commented Oct 31, 2022

issue is resolved via #4699

v1.2.0-rc.1 metrics

  • novc

Screen Shot 2022-10-31 at 08 56 16

  • lg1k

Screen Shot 2022-10-31 at 08 56 40

these metrics are the same to stable group (v1.1.1)

@twoeths twoeths closed this as completed Oct 31, 2022
@philknows
Copy link
Member

philknows commented Nov 4, 2022

Adding note for reference, libp2p metrics was causing this. Fixed by disabling here: #4699

Followed up for investigation under #4698.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prio-high Resolve issues as soon as possible.
Projects
None yet
Development

No branches or pull requests

2 participants