-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Merged by Bors] - Speed up CommandQueue
by storing commands more densely
#6391
Closed
Closed
Changes from 48 commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
24b2748
Store commands contiguously
JoJoJet c1df95d
use `read_unaligned`
JoJoJet b71240c
add some safety comments
JoJoJet 648cc38
optimize some repeated additions
JoJoJet b60f326
use ptr methods
JoJoJet 70a984e
Optimize for zero-sized types
JoJoJet 6b488fb
add safety comments to buffer writes
JoJoJet 81a6d45
Add safety comments for pointer offsets
JoJoJet 911b0fa
fix a word
JoJoJet c41cf9e
add a semicolon
JoJoJet f2bf50a
use a pointer write instead of copy_nonoverlapping
JoJoJet 2274cde
finish a comment
JoJoJet c5ef708
use more pointer writes
JoJoJet 5939090
inline a const
JoJoJet ed519de
import mem
JoJoJet c0e8694
Add a line break
JoJoJet 6ef733e
move `set_len` closer to buffer writes
JoJoJet ca0b703
deduplicate pointer additions
JoJoJet f91f592
make sure some consts can get folded
JoJoJet 0b856d9
clarify a comment
JoJoJet 5a16594
Rename `cursor` -> `ptr`
JoJoJet 435b28e
update an outdated comment
JoJoJet 739c45b
return the size of a command from the function pointer
JoJoJet 601025a
make a function name more explicit
JoJoJet ce4d864
refactor safety invariants for fn pointers
JoJoJet a24bdcc
Add another safety comment
JoJoJet 64b1177
Improve a comment
JoJoJet 7c7f775
tweak some comments
JoJoJet 494240a
fix another outdated comment
JoJoJet f94d2d3
describe the format more naturally
JoJoJet 92e9bf5
Improve docs for `CommandQueue`
JoJoJet 3d24081
improve safety comments
JoJoJet 16ceb57
be more explicit about ZSTs
JoJoJet 7706eae
Update some old comments
JoJoJet daa6614
add `OwningPtr::read_unaligned`
JoJoJet 453c6df
use owning pointers for commands
JoJoJet 459eaa7
nitpick safety comments
JoJoJet f469f05
Merge remote-tracking branch 'upstream/main' into command-opt
JoJoJet 1fecbae
Merge remote-tracking branch 'upstream/main' into command-opt
JoJoJet 144eb7e
remove a duplicate fn
JoJoJet 8e288e9
remove a turbofish
JoJoJet 040e85d
reduce churn
JoJoJet f7a5b7a
reduce more comment churn
JoJoJet 41c6183
copy another comment from upstream
JoJoJet 4080b5a
use a packed struct to simplify writing
JoJoJet 7ca7a54
tweak language for a comment
JoJoJet febaf23
Merge remote-tracking branch 'upstream/main' into command-opt
JoJoJet bc1741c
rename `WithMeta` -> `Packed`
JoJoJet 9791ea6
use turbofish
JoJoJet d6f2e5c
add a comment to `Packed`
JoJoJet 3142fe8
`C` -> `packed`
JoJoJet 9deaee0
make a safety comment more rigorous
JoJoJet 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 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.
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.