servo / rust-url

URL parser for Rust
https://docs.rs/url/
Apache License 2.0
1.31k stars 325 forks source link

percent_encoding: faster percent_encode_byte #814

Closed klensy closed 1 year ago

klensy commented 1 year ago

Read encode table as &[u8; 768] instead of &str, so we statically know offsets and can skip bound checks, making it branchless.

https://rust.godbolt.org/z/r8bo3M9TP

klensy commented 1 year ago

Looking at function size, it can be marked as inline?

klensy commented 1 year ago

Added inline.