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

Optimize merge #303

Merged
merged 10 commits into from
Aug 12, 2023
Merged

Optimize merge #303

merged 10 commits into from
Aug 12, 2023

Conversation

ces42
Copy link
Contributor

@ces42 ces42 commented Jul 17, 2023

This PR tries to make the merge() step in the pipeline more efficient (and also the execute() step a bit).

The most drastic (and functional) change is that I tried removing the condition-mechanism in Searcher. It seems to me like we might as well always "use :skip"? In that case the searcher will try to avoid skipping anyway and only skip if necessary. The only effect of the condition-mechanism is that if we don't skip when find_execute_key() is called in Runner.merge() then we're not allowed to skip in Runner.execute(). I can't actually come up with a situation where this would be the case.

Benchmark: I ran 20000.times { pipeline } with both versions, feeding them touchpad events that I had recorded for a couple of hours. The results show a ~10% speedup.

version time
current master (b68ab60) 5.987 s ± 0.112 s
PR keeping condition (d6f5b77) 5.534 s ± 0.034 s
PR removing condition (dd13176) 5.384 s ± 0.023 s

Copy link
Owner

@iberianpig iberianpig left a comment

Choose a reason for hiding this comment

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

Thank you for the wonderful optimizations. The code has become simpler as well. I appreciate your contribution.

@iberianpig iberianpig merged commit 193a653 into iberianpig:master Aug 12, 2023
6 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