Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

refactor: Faster copy loop #16

Merged
merged 1 commit into from
Jun 10, 2022
Merged

Conversation

ninegua
Copy link
Member

@ninegua ninegua commented Jun 10, 2022

The cost of using a recursive function in copying some bytes is not negligible and actually shows up as a cost center in flamegraph.

The fix is simple: use a while loop to do the copy.

@ninegua ninegua requested a review from a team as a code owner June 10, 2022 23:51
@ninegua
Copy link
Member Author

ninegua commented Jun 10, 2022

In case you wonder:

image

@lwshang lwshang merged commit 71644a2 into dfinity:main Jun 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants