-
Notifications
You must be signed in to change notification settings - Fork 15
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
Loop plus match #248
Loop plus match #248
Commits on Nov 14, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 6de9627 - Browse repository at this point
Copy the full SHA 6de9627View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e71c5a - Browse repository at this point
Copy the full SHA 9e71c5aView commit details -
Configuration menu - View commit details
-
Copy full SHA for c5c8534 - Browse repository at this point
Copy the full SHA c5c8534View commit details -
inflate: more conservative bounds checking on gz header fields
Paranoia: If self.length is miscalculated to be past {extra,name,comm}_max, it could result in us sending a pointer out of bounds when we do `ptr.add(self.length)`. Usually the number of bytes would be zero, but sending a pointer OOB with `ptr.add()` is automatic UB even if we don't actually count any bytes. We do have a guardrail against underflowing subtraction against self.length, but we should check and panic instead of saturating. Better safe than sorry.
Configuration menu - View commit details
-
Copy full SHA for b7c36e1 - Browse repository at this point
Copy the full SHA b7c36e1View commit details -
Configuration menu - View commit details
-
Copy full SHA for ede7792 - Browse repository at this point
Copy the full SHA ede7792View commit details -
inflate: safety comment around unchecked unreachable
Add a safety comment around this unchecked unreachable statement, and convert the integer literals to binary literals to make it more obvious that the match statement is matching against bits.
Configuration menu - View commit details
-
Copy full SHA for 8664a7a - Browse repository at this point
Copy the full SHA 8664a7aView commit details -
use safe
unreachable!
macro instead ofunreachable_unchecked
llvm is able to optimize the branch away anyway https://godbolt.org/z/x9srqoMjj so we can just have less unsafe code
Configuration menu - View commit details
-
Copy full SHA for 75efd27 - Browse repository at this point
Copy the full SHA 75efd27View commit details -
fn dispatch
: usebreak
instead ofreturn
this does not yet cover the macros
Configuration menu - View commit details
-
Copy full SHA for bb72819 - Browse repository at this point
Copy the full SHA bb72819View commit details -
load the inflate reader and writer to the stack
Benchmark 2 (66 runs): target/release/examples/blogpost-uncompress rs-chunked 4 silesia-small.tar.gz measurement mean ± σ min … max outliers delta wall_time 76.8ms ± 2.42ms 75.6ms … 95.5ms 3 ( 5%) ⚡- 3.9% ± 1.1% peak_rss 24.1MB ± 73.9KB 23.9MB … 24.1MB 0 ( 0%) - 0.0% ± 0.1% cpu_cycles 308M ± 9.07M 305M … 378M 5 ( 8%) ⚡- 4.0% ± 1.0% instructions 941M ± 236 941M … 941M 0 ( 0%) ⚡- 2.3% ± 0.0% cache_references 3.08M ± 335K 2.78M … 5.42M 3 ( 5%) 💩+ 4.5% ± 3.2% cache_misses 126K ± 25.3K 87.0K … 263K 2 ( 3%) 💩+ 94.9% ± 13.4% branch_misses 4.08M ± 7.54K 4.07M … 4.13M 3 ( 5%) - 0.2% ± 0.1%
Configuration menu - View commit details
-
Copy full SHA for d5a26df - Browse repository at this point
Copy the full SHA d5a26dfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6977768 - Browse repository at this point
Copy the full SHA 6977768View commit details