Skip to content

Conversation

alexheretic
Copy link
Contributor

@alexheretic alexheretic commented Sep 13, 2025

Optimisation opportunity highlighted by testing against String perf and using benchmarks in #96.

PR bench

group                                  master                  faster-ascii-case
-----                                  ------                  -----------------
to_ascii_lowercase_smolstr len=12      2.06     13.5±0.01ns    1.00      6.6±0.01ns
to_ascii_lowercase_smolstr len=50      4.31    110.3±0.19ns    1.00     25.6±0.07ns
to_ascii_lowercase_smolstr len=1000    22.17  1396.8±2.63ns    1.00     63.0±0.01ns

The change provides a significant perf improvement on inline & heap reprs. Also faster than String for len=12 now 🙂

Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

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

Thanks!

@Veykril Veykril merged commit b3ac1b5 into rust-analyzer:master Sep 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants