mirror of
https://github.com/rwf2/Rocket.git
synced 2025-01-03 16:22:37 +00:00
299a422cbc
Differential and causal profiling determined that 35% of `Hello, world!` dispatch time was spent rendering `Content-Type` due to many calls to `fmt` in `MediaType::Display` and an allocation in `ContentType::Into<Header>`. This change reduces the number of calls to `fmt` to 1 in `MediaType::Display` and removes the allocation in `Into<Header>` for known media types. This change also caches a `Rocket` "precheck" so that pre-dispatch checks are done only a single time for a given `Rocket` instance, further reducing `MockRequest::dispatch_with` time for "Hello, world!" by roughly 15%. |
||
---|---|---|
.. | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml |