Skip to content

perf: use simdutf for idna #960

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

Merged
merged 9 commits into from
Jun 30, 2025
Merged

perf: use simdutf for idna #960

merged 9 commits into from
Jun 30, 2025

Conversation

CarlosEduR
Copy link
Member

@anonrig shared this idea with me and I wanted to see the results

before

--------------------------------------------------------------------------------------------
Benchmark                                  Time             CPU   Iterations UserCounters...
--------------------------------------------------------------------------------------------
BasicBench_AdaURL_href              32908890 ns     32906402 ns           21 GHz=4.24613 cycle/byte=15.8536 cycles/url=1.37703k instructions/byte=37.7937 instructions/cycle=2.38392 instructions/ns=10.1224 instructions/url=3.28273k ns/url=324.304 speed=264.024M/s time/byte=3.78753ns time/url=328.982ns url/s=3.03968M/s
BasicBench_AdaURL_aggregator_href   21605908 ns     21603424 ns           33 GHz=4.26986 cycle/byte=10.2508 cycles/url=890.373 instructions/byte=26.2693 instructions/cycle=2.56267 instructions/ns=10.9422 instructions/url=2.28173k ns/url=208.525 speed=402.163M/s time/byte=2.48656ns time/url=215.98ns url/s=4.63005M/s
BasicBench_AdaURL_CanParse          15095033 ns     15092217 ns           47 GHz=4.23117 cycle/byte=7.21498 cycles/url=626.687 instructions/byte=18.7941 instructions/cycle=2.60487 instructions/ns=11.0217 instructions/url=1.63244k ns/url=148.112 speed=575.667M/s time/byte=1.73712ns time/url=150.884ns url/s=6.62759M/s

after

--------------------------------------------------------------------------------------------
Benchmark                                  Time             CPU   Iterations UserCounters...
--------------------------------------------------------------------------------------------
BasicBench_AdaURL_href              32280303 ns     32270116 ns           22 GHz=4.25771 cycle/byte=15.6389 cycles/url=1.35838k instructions/byte=37.6977 instructions/cycle=2.41051 instructions/ns=10.2633 instructions/url=3.27439k ns/url=319.04 speed=269.23M/s time/byte=3.71429ns time/url=322.621ns url/s=3.09962M/s
BasicBench_AdaURL_aggregator_href   21437868 ns     21435694 ns           33 GHz=4.26525 cycle/byte=10.2537 cycles/url=890.632 instructions/byte=26.2922 instructions/cycle=2.56415 instructions/ns=10.9368 instructions/url=2.28372k ns/url=208.811 speed=405.31M/s time/byte=2.46725ns time/url=214.303ns url/s=4.66628M/s
BasicBench_AdaURL_CanParse          15485840 ns     15484628 ns           46 GHz=4.26607 cycle/byte=7.43332 cycles/url=645.652 instructions/byte=18.6752 instructions/cycle=2.51237 instructions/ns=10.7179 instructions/url=1.62212k ns/url=151.346 speed=561.079M/s time/byte=1.78228ns time/url=154.808ns url/s=6.45963M/s

@anonrig anonrig requested a review from lemire June 22, 2025 01:00
@lemire
Copy link
Member

lemire commented Jun 22, 2025

Good work. Whether it is worth it depends on the input strings, evidently. :-)

Copy link
Member

@anonrig anonrig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add this flag info to readme as well?

@anonrig
Copy link
Member

anonrig commented Jun 22, 2025

Can you open the same pull-request to ada-idna first, and later update this pull-request with ada-idea version and then add cmakelist changes?

@anonrig
Copy link
Member

anonrig commented Jun 29, 2025

This is ready to land except:

  • updating GitHub workflows to run with simdutf
  • add a documentation about this flag

@CarlosEduR
Copy link
Member Author

github workflow ubuntu.yml (Ubuntu 22.04) updated, and README updated with new option too.

@anonrig anonrig marked this pull request as ready for review June 30, 2025 02:42
@anonrig anonrig merged commit a85298d into ada-url:main Jun 30, 2025
47 checks passed
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.

3 participants