-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
Simd percent decoder (#458) #459
base: main
Are you sure you want to change the base?
Conversation
* incorporate simd percent decoder * fixing some comments * made avx512 version match existing behavior on malformed input * made avx2 version match existing behavior on malformed input. made percent_decode_slow the fallback on non-x64_64 or x64_64 lacking avx2, which required changing the function signature of percent_decode_slow. deleted simde version since simde would require an external dependency. * got rid of a few instructions in AVX2 version --------- Co-authored-by: Jeff Plaisance <[email protected]>
I wouldn't expect improving percent decoding performance to make a huge difference in the benchmarks right now, since it seems that currently percent decoding is only performed while parsing the host. I'd expect it to make a substantial difference when parsing query strings in long URLs. |
I believe in either scenario, we can expose this under |
Ah ! Ah ! This was so before TEST(url_search_params, with_accents) {
auto search_params = ada::url_search_params();
search_params.append("key1", "été");
search_params.append("key2", "Céline Dion++");
ASSERT_EQ(search_params.size(), 2);
ASSERT_EQ(search_params.to_string(), "key1=%C3%A9t%C3%A9&key2=C%C3%A9line+Dion%2B%2B");
ASSERT_EQ(search_params.get("key1"), "été");
ASSERT_EQ(search_params.get("key2"), "Céline Dion++");
SUCCEED();
} |
@jeffplaisance and @anonrig : I think we need a new benchmark where we could make this code shine. What sort of applications tend to generate long URLs with longer percent encoded search values? It does not need to be a real use case, but it should be realistic. |
here are some really long examples from indeed.com, these are authentication redirects which is probably a good example of a scenario where long URLs with lots of percent encoded data are common: to generate more we could take some regular urls from an existing benchmark, percent encode them, and put them as a query parameter in a new url |
@jeffplaisance That's helpful. I'll work on a benchmark "soon". Update: Done by #477 |
We have a precursor PR: #478 |
Incorporate simd percent decoder (Jeff Plaisance). Currently, this does not shine in our benchmarks.
credit: @jeffplaisance