-
-
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
Open
JukkaL
wants to merge
27
commits into
master
Choose a base branch
from
serialize-buffer-prim
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+514
−275
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
fbd0e54
Move data type check to wrapper functions
JukkaL 934c091
Update stubs
JukkaL 2283ef9
Split Buffer into WriteBuffer and ReadBuffer
JukkaL 94e116b
Update test case
JukkaL 20e7df4
Update more tests
JukkaL a5069a8
Fix stubs
JukkaL 0eb8639
Simlify
JukkaL 3118407
Fix growing the buffer
JukkaL 31773bf
WIP benchmark
JukkaL ad02c93
Optimize API calls
JukkaL 4c3f219
Run 10x more iterations
JukkaL 7695140
Update benchmark
JukkaL 1297eb3
Update API len
JukkaL 45695d9
Fix after rebase
JukkaL f97cc7c
Fix test case to use ReadBuffer
JukkaL 3eaa989
Fix irbuild test case to use WriteBuffer_internal
JukkaL 4fb6b1f
Fix run test to use WriteBuffer/ReadBuffer consistently
JukkaL e1311be
Fix WriteBuffer writes in C lib
JukkaL e4d0c03
Bump ABI version
JukkaL 84b6a70
Provide access to the type objects via API
JukkaL c74f01d
Perform runtime type checks
JukkaL 2492712
Revert benchmark related changes
JukkaL 906bd71
Test arg checking when calling via wrapper functions
JukkaL b1b1d9b
Fix stub
JukkaL a568b9c
Hacky support in stub for both the old and new APIs
JukkaL 2e33147
Minor fixes
JukkaL b9ffa18
Minor optimization
JukkaL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
|
|
||
| class Buffer: | ||
| def __init__(self, source: bytes = ...) -> None: ... | ||
| def getvalue(self) -> bytes: ... | ||
|
|
||
| def write_bool(data: Buffer, value: bool) -> None: ... | ||
| def read_bool(data: Buffer) -> bool: ... | ||
| def write_str(data: Buffer, value: str) -> None: ... | ||
| def read_str(data: Buffer) -> str: ... | ||
| def write_bytes(data: Buffer, value: bytes) -> None: ... | ||
| def read_bytes(data: Buffer) -> bytes: ... | ||
| def write_float(data: Buffer, value: float) -> None: ... | ||
| def read_float(data: Buffer) -> float: ... | ||
| def write_int(data: Buffer, value: int) -> None: ... | ||
| def read_int(data: Buffer) -> int: ... | ||
| def write_tag(data: Buffer, value: u8) -> None: ... | ||
| def read_tag(data: Buffer) -> u8: ... | ||
| class ReadBuffer: | ||
| def __init__(self, source: bytes) -> None: ... | ||
|
|
||
| class WriteBuffer: | ||
| def getvalue(self) -> bytes: ... | ||
|
|
||
| def write_bool(data: WriteBuffer | Buffer, value: bool) -> None: ... | ||
| def read_bool(data: ReadBuffer | Buffer) -> bool: ... | ||
| def write_str(data: WriteBuffer | Buffer, value: str) -> None: ... | ||
| def read_str(data: ReadBuffer | Buffer) -> str: ... | ||
| def write_bytes(data: WriteBuffer | Buffer, value: bytes) -> None: ... | ||
| def read_bytes(data: ReadBuffer | Buffer) -> bytes: ... | ||
| def write_float(data: WriteBuffer | Buffer, value: float) -> None: ... | ||
| def read_float(data: ReadBuffer | Buffer) -> float: ... | ||
| def write_int(data: WriteBuffer | Buffer, value: int) -> None: ... | ||
| def read_int(data: ReadBuffer | Buffer) -> int: ... | ||
| def write_tag(data: WriteBuffer | Buffer, value: u8) -> None: ... | ||
| def read_tag(data: ReadBuffer | Buffer) -> u8: ... | ||
| def cache_version() -> u8: ... | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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?