borngraced opened a new pull request, #3102:
URL: https://github.com/apache/fory/pull/3102
## Why?
All `set_bytes` callers follow the same pattern: save `writer.len()` as
offset, write placeholder bytes (via `write_*`/`skip`), then call `set_bytes`
to back-fill. Since bounds are already guaranteed by this usage pattern, the
runtime checks are redundant I guess. This allows us to optimize them away
while keeping a `debug_assert!` for safety...
## What does this PR do?
Replace bounds-checked `get_mut().unwrap().copy_from_slice()` with direct
`ptr::copy_nonoverlapping`.
- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?
## Benchmark
No benchmarks yet, but the improvement should be noticeable:
https://godbolt.org/z/75bhPWxfW
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]