Skip to content
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

Handle URL encoding/decoding #110

Merged
merged 7 commits into from
Aug 19, 2024
Merged

Conversation

CathalMullan
Copy link
Contributor

@CathalMullan CathalMullan commented Aug 15, 2024

Happy path works well.
Need to think about the use of unsafe in fetching parameters.

We want to avoid duplicate UTF-8 safety checks.

With out current approach, we could just have 2 methods for searching. Then we'd cut out the if statement per search.

API isn't set in stone. Keep it as is for now?
Issue with the Path API is that if we try to search decoded, then search non-decoded, we'll use the decoded version.

Maybe force everyone through the encoded path?
How would that work for HTTP-adjacent use cases? Like gRPC (Tonic)?

EDIT: Removed regex. Wasn't confident in the implementation.

Marking this implementation as 'good enough' for now.
Not like I'm releasing this code yet, anyways.

Just need to add more tests to showcase nuances in encoding specs.

@CathalMullan CathalMullan linked an issue Aug 15, 2024 that may be closed by this pull request
Copy link

codspeed-hq bot commented Aug 15, 2024

CodSpeed Performance Report

Merging #110 will degrade performances by 29.73%

Comparing 8-investigate-url-encodingdecoding (60a3fd6) with main (4924ae1)

Summary

❌ 11 regressions
✅ 5 untouched benchmarks

⁉️ 2 dropped benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main 8-investigate-url-encodingdecoding Change
matchit benchmarks/matchit 8.1 µs 11.2 µs -27.7%
matchit benchmarks/ntex-router 28.1 µs 31.6 µs -11.13%
matchit benchmarks/path-tree 10.8 µs 13.6 µs -20.64%
⁉️ matchit benchmarks/regex 53.9 µs N/A N/A
matchit benchmarks/route-recognizer 39.7 µs 42.3 µs -6.26%
matchit benchmarks/wayfind 8.1 µs 10.1 µs -20.19%
matchit benchmarks/xitca-router 8.8 µs 12.5 µs -29.73%
path-tree benchmarks/matchit 61.4 µs 75.3 µs -18.46%
path-tree benchmarks/ntex-router 231.2 µs 245.5 µs -5.83%
path-tree benchmarks/path-tree 72.9 µs 86 µs -15.28%
⁉️ path-tree benchmarks/regex 715.1 µs N/A N/A
path-tree benchmarks/wayfind 42.5 µs 49 µs -13.33%
path-tree benchmarks/xitca-router 68.3 µs 82.2 µs -16.96%

@CathalMullan CathalMullan force-pushed the 8-investigate-url-encodingdecoding branch 4 times, most recently from 60cad2e to a2868e7 Compare August 19, 2024 14:28
@CathalMullan CathalMullan force-pushed the 8-investigate-url-encodingdecoding branch 2 times, most recently from 5dbb6a4 to b3ea7bd Compare August 19, 2024 14:48
@CathalMullan CathalMullan force-pushed the 8-investigate-url-encodingdecoding branch from b3ea7bd to dfe83cf Compare August 19, 2024 15:12
@CathalMullan CathalMullan marked this pull request as ready for review August 19, 2024 15:21
@CathalMullan CathalMullan force-pushed the 8-investigate-url-encodingdecoding branch from dc3b3a0 to 18e1b63 Compare August 19, 2024 18:07
@CathalMullan CathalMullan force-pushed the 8-investigate-url-encodingdecoding branch from afb8b9d to 75ab007 Compare August 19, 2024 19:52
@CathalMullan CathalMullan force-pushed the 8-investigate-url-encodingdecoding branch from 75ab007 to 4f5cece Compare August 19, 2024 19:53
@CathalMullan CathalMullan merged commit 8eed1e1 into main Aug 19, 2024
1 check passed
@CathalMullan CathalMullan deleted the 8-investigate-url-encodingdecoding branch August 19, 2024 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate URL encoding/decoding
1 participant