You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@mdboom sorry for noticing this late, but I am confused by the diff -- it seems like this PR just fixes a recently-introduced (I think) regression? We've fixed this enum issue long time ago by a fast dict lookup (#546), but that fix seems to be gone (and replaced by a presumably even-faster memoization in this PR).
it seems like this PR just fixes a recently-introduced (I think) regression?
Ah, I see. The "regression" was introduced in the fast enum refactoring (#1581). So with this PR it means regardless of how fast the enum implementation (builtin or custom) is the memoization is always needed... 🙂
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #1638 for details as to why this works.
On my machine with the #659 benchmark, I see a reduction from 3.02us to 2.54us per iteration.