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

rewrite double quote strings with many escapes to use ~s #146

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

novaugust
Copy link
Contributor

@novaugust novaugust commented Mar 28, 2024

styler rewriting strings with many escapes involves running regexes against all string literals to detect too many escapes. was worried regexing like that would be too costly but… i think 3/100ths of a second in a repo as large as we have at frame is acceptable?

➜  frameio git:(me/styler-test) hyperfine 'mix format' -i --warmup 1 # with string sigils
Benchmark 1: mix format
  Time (mean ± σ):      3.589 s ±  0.024 s    [User: 16.577 s, System: 1.975 s]
  Range (min … max):    3.556 s …  3.638 s    10 runs

➜  frameio git:(me/styler-test) hyperfine 'mix format' -i --warmup 1 # without string sigils
Benchmark 1: mix format
  Time (mean ± σ):      3.553 s ±  0.027 s    [User: 16.527 s, System: 1.977 s]
  Range (min … max):    3.516 s …  3.602 s    10 runs

@novaugust novaugust force-pushed the me/string-sigils branch 5 times, most recently from 3479219 to dd13148 Compare March 28, 2024 19:07
@novaugust novaugust merged commit c29b841 into main Mar 28, 2024
4 checks passed
@novaugust novaugust deleted the me/string-sigils branch March 28, 2024 19:12
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.

1 participant