-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Micro-optimize cache primitives in librt.internal #20194
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
base: master
Are you sure you want to change the base?
Conversation
Only one of these works at runtime, however.
|
Compiled mypy is expected to fail in CI, since we need to publish a new version of |
ilevkivskyi
left a comment
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.
LG, thanks! Just few minor things. I think it is fine to break CI for short time. It would be good to fix it before weekend (there may be some contributors who may be confused by the failure).
| @@ -1,19 +1,27 @@ | |||
| from mypy_extensions import u8 | |||
|
|
|||
| # TODO: Remove Buffer -- right now we have hacky support for BOTH the old and new APIs | |||
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.
When will we be able to remove it? Right after the new version of librt is published, right?
| with assertRaises(ValueError): | ||
| read_int(r) | ||
|
|
||
| def test_buffer_primitive_types() -> None: |
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.
You forgot to add calls to this tests, and to the two tests below (you only added test_buffer_grow()).
This includes the following optimizations:
This improves the performance of a micro-benchmark that reads integers in a loop by 5%, but this could help more if we'd inline some of the smaller functions (in the future). By making the functions simpler, inlining is more feasible.
I'm not sure what's the best way to merge this -- maybe we'll need to have broken master for a while, and then we ca publish a new version of
librt, and then update mypy to work using the newlibrtversion.