-
Notifications
You must be signed in to change notification settings - Fork 49
Faster Processor resets #776
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
Conversation
rdar://137810309 |
Refactor executor interfaces as well
Make processor reset faster by tracking dirty registers and only clearing Arrays that are non-empty.
1d27b13
to
89ab30e
Compare
Perf vs #773:
|
@swift-ci please test |
@@ -128,6 +135,9 @@ extension Processor.Registers { | |||
} | |||
|
|||
mutating func reset(sentinel: Input.Index) { | |||
guard isDirty else { | |||
return | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to reset isDirty
here, as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoot, let's see if that affects numbers...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you mean we can set isDirty = false
outside of the guard statement? Right, that will actually be an improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing that change doesn't affect correctness, just allows us to reset less often. This nets us 10-15% in the Hangul benchmarks! I'll include this improvement in an up-coming PR.
Make processor reset faster by tracking dirty registers
and only clearing Arrays that are non-empty.
Built on top of #773