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

Implement is_identifier_character using JS regexp (wasm) #113

Closed
strager opened this issue Dec 26, 2020 · 2 comments
Closed

Implement is_identifier_character using JS regexp (wasm) #113

strager opened this issue Dec 26, 2020 · 2 comments
Labels
performance Slowness or potential optimization

Comments

@strager
Copy link
Collaborator

strager commented Dec 26, 2020

After compilation, lex-unicode.cpp is huge. This increases download time for quick-lint-js, making the demo less fun.

JavaScript regular expressions can match based on Unicode character properties (e.g. /\p{L}/u for letters). For wasm-compiled code which runs in Node.js and in the browser, implement lexer::is_identifier_character and lexer::is_initial_identifier_character using JavaScript regexps instead of the existing lookup table.

I estimate this'll reduce uncompressed download sizes by about 130 KiB, and reduce compressed download sizes by about 30 KiB.

@CodeItQuick
Copy link
Contributor

Dibs!

@strager strager removed this from the public release (v1.0) milestone Jan 26, 2021
@strager strager added the performance Slowness or potential optimization label Dec 2, 2021
@strager
Copy link
Collaborator Author

strager commented Apr 15, 2022

Given #542, I think this task is a bad idea. We want our own tables to support different Unicode versions.

@strager strager closed this as completed Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Slowness or potential optimization
Projects
None yet
Development

No branches or pull requests

2 participants