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

refactor(parser): remove string builder from number parsing #2002

Merged

Conversation

Boshen
Copy link
Member

@Boshen Boshen commented Jan 12, 2024

The builder was used to build an allocated string for numbers with
underscores, this is no longer required because it is now allocated on
demand.

let s = if s.contains('_') { Cow::Owned(s.replace('_', "")) } else { Cow::Borrowed(s) };

Copy link
Member Author

Boshen commented Jan 12, 2024

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

@github-actions github-actions bot added the A-parser Area - Parser label Jan 12, 2024
Copy link

codspeed-hq bot commented Jan 12, 2024

CodSpeed Performance Report

Merging #2002 will not alter performance

Comparing 01-12-refactor_parser_remove_string_builder_from_number_parsing (fac1308) with main (39f026f)

Summary

✅ 14 untouched benchmarks

The builder was used to build an allocated string for numbers with
underscores, this is no longer required because it is now allocated on
demand.

https://github.com/oxc-project/oxc/blob/0d77e1e788440ca4d5fe047ca4bdea7a01ed6210/crates/oxc_parser/src/lexer/number.rs#L32
@Boshen Boshen force-pushed the 01-12-refactor_parser_remove_string_builder_from_number_parsing branch from 2ae1b8d to fac1308 Compare January 12, 2024 08:38
@Boshen Boshen merged commit 38f86b0 into main Jan 12, 2024
18 checks passed
@Boshen Boshen deleted the 01-12-refactor_parser_remove_string_builder_from_number_parsing branch January 12, 2024 09:01
IWANABETHATGUY pushed a commit to IWANABETHATGUY/oxc that referenced this pull request May 29, 2024
…ect#2002)

The builder was used to build an allocated string for numbers with
underscores, this is no longer required because it is now allocated on
demand.


https://github.com/oxc-project/oxc/blob/0d77e1e788440ca4d5fe047ca4bdea7a01ed6210/crates/oxc_parser/src/lexer/number.rs#L32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area - Parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant