DuskSystems / wayfind

A speedy, flexible router for Rust.
Apache License 2.0
8 stars 0 forks source link

Remove unsafe usage #137

Closed CathalMullan closed 2 months ago

CathalMullan commented 2 months ago

Fuzzers work!

Need to think about how to optimize the UTF-8 checks.

Should we delay UTF-8 checks until post-inner-search? Or would that result in unnecessary work?

Could we remove the UTF-8 check after percent-decoding? Since we never actually return the provided decoded path.

Could we still use unsafe for the 'key'?

codspeed-hq[bot] commented 2 months ago

CodSpeed Performance Report

Merging #137 will degrade performances by 10.43%

Comparing 136-remove-unsage-usage-from-parameter-extraction (1b5d420) with main (96e9b7c)

Summary

❌ 2 regressions ✅ 14 untouched benchmarks

:warning: Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main 136-remove-unsage-usage-from-parameter-extraction Change
matchit benchmarks/wayfind 11.8 µs 13.1 µs -9.88%
path-tree benchmarks/wayfind 58.9 µs 65.7 µs -10.43%
codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 73.26733% with 27 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/node/search.rs 56.89% 9 Missing and 16 partials :warning:
src/router.rs 75.00% 1 Missing and 1 partial :warning:
Files with missing lines Coverage Δ
src/errors/path.rs 100.00% <ø> (ø)
src/errors/search.rs 100.00% <100.00%> (ø)
src/path.rs 100.00% <100.00%> (ø)
src/router.rs 90.83% <75.00%> (-0.70%) :arrow_down:
src/node/search.rs 88.00% <56.89%> (-10.65%) :arrow_down:

... and 1 file with indirect coverage changes