-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
[Merged by Bors] - Speed up CommandQueue by storing commands more densely
#6391
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
Closed
Closed
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
24b2748
Store commands contiguously
joseph-gio c1df95d
use `read_unaligned`
joseph-gio b71240c
add some safety comments
joseph-gio 648cc38
optimize some repeated additions
joseph-gio b60f326
use ptr methods
joseph-gio 70a984e
Optimize for zero-sized types
joseph-gio 6b488fb
add safety comments to buffer writes
joseph-gio 81a6d45
Add safety comments for pointer offsets
joseph-gio 911b0fa
fix a word
joseph-gio c41cf9e
add a semicolon
joseph-gio f2bf50a
use a pointer write instead of copy_nonoverlapping
joseph-gio 2274cde
finish a comment
joseph-gio c5ef708
use more pointer writes
joseph-gio 5939090
inline a const
joseph-gio ed519de
import mem
joseph-gio c0e8694
Add a line break
joseph-gio 6ef733e
move `set_len` closer to buffer writes
joseph-gio ca0b703
deduplicate pointer additions
joseph-gio f91f592
make sure some consts can get folded
joseph-gio 0b856d9
clarify a comment
joseph-gio 5a16594
Rename `cursor` -> `ptr`
joseph-gio 435b28e
update an outdated comment
joseph-gio 739c45b
return the size of a command from the function pointer
joseph-gio 601025a
make a function name more explicit
joseph-gio ce4d864
refactor safety invariants for fn pointers
joseph-gio a24bdcc
Add another safety comment
joseph-gio 64b1177
Improve a comment
joseph-gio 7c7f775
tweak some comments
joseph-gio 494240a
fix another outdated comment
joseph-gio f94d2d3
describe the format more naturally
joseph-gio 92e9bf5
Improve docs for `CommandQueue`
joseph-gio 3d24081
improve safety comments
joseph-gio 16ceb57
be more explicit about ZSTs
joseph-gio 7706eae
Update some old comments
joseph-gio daa6614
add `OwningPtr::read_unaligned`
joseph-gio 453c6df
use owning pointers for commands
joseph-gio 459eaa7
nitpick safety comments
joseph-gio f469f05
Merge remote-tracking branch 'upstream/main' into command-opt
joseph-gio 1fecbae
Merge remote-tracking branch 'upstream/main' into command-opt
joseph-gio 144eb7e
remove a duplicate fn
joseph-gio 8e288e9
remove a turbofish
joseph-gio 040e85d
reduce churn
joseph-gio f7a5b7a
reduce more comment churn
joseph-gio 41c6183
copy another comment from upstream
joseph-gio 4080b5a
use a packed struct to simplify writing
joseph-gio 7ca7a54
tweak language for a comment
joseph-gio febaf23
Merge remote-tracking branch 'upstream/main' into command-opt
joseph-gio bc1741c
rename `WithMeta` -> `Packed`
joseph-gio 9791ea6
use turbofish
joseph-gio d6f2e5c
add a comment to `Packed`
joseph-gio 3142fe8
`C` -> `packed`
joseph-gio 9deaee0
make a safety comment more rigorous
joseph-gio 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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
This needs a comment as to why we need
repr(packed)here. Preferably with a link to the appropriate Rustinomicon page. Probably also a safety comment too asrepr(packed)can make UB from safe code.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.
Good point
Rustc currently has a deny-by-default lint for that unsoundness, which will later get promoted into a hard error. IMO we can get away with just not worrying about it -- if this code compiles, then we know it's safe.