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

GetRequestablePieces: remove runtime correctness check #902

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

veshij
Copy link
Contributor

@veshij veshij commented Feb 9, 2024

In profiles I collected correctness check

// Check that scan emits pieces in priority order.
if lastItem.Ok {
if _i.Less(&lastItem.Value) {
panic("scan not in order")
}
}
lastItem.Set(_i)
takes up to 10% cpu time. Would it make sense to remove it from runtime and add a unit-test for that instead (if not already)?

Screenshot 2024-02-07 at 11 25 12 PM

additional discussion is in #897 (comment)

@anacrolix
Copy link
Owner

I tried this on top of #897 (comment), and it knocked off another 10%. This can be merged independently of evaluating that other change. Thanks for the contribution!

@anacrolix anacrolix merged commit 1416648 into anacrolix:master Feb 9, 2024
7 of 10 checks passed
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.

2 participants