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

Use PushableAbortable #434

Closed
wants to merge 1 commit into from
Closed

Conversation

dapplion
Copy link
Contributor

@dapplion dapplion commented Jun 12, 2023

Motivation

In high traffic apps like a beacon node, abortableSource takes +1% of total CPU time.

Description

This PR removes the need for one loop of abortableSource in each outbound packet. Uses a simplified implementation of pushable with abort capacity using Lodestar's LinkedList https://github.com/ChainSafe/lodestar/blob/09ecf9957c33c3bdf79645dbd27979bdb0514c56/packages/beacon-node/src/util/array.ts#L32 and AsyncIterator from https://github.com/ChainSafe/lodestar/blob/09ecf9957c33c3bdf79645dbd27979bdb0514c56/packages/beacon-node/src/util/asyncIterableToEvents.ts#L53

@dapplion dapplion requested a review from a team as a code owner June 12, 2023 11:02
@dapplion dapplion marked this pull request as draft June 12, 2023 11:03
@wemeetagain
Copy link
Member

We might wait for libp2p/js-libp2p#1793 (comment) (check last few paragraphs of the comment) to be implemented which will give us abortable sources at a lower level.

@wemeetagain
Copy link
Member

closing in favor of #488

@wemeetagain wemeetagain closed this Feb 5, 2024
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.

None yet

2 participants