-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
5$: refactor: Reuse simdjson's number parsing in quick-lint-js #915
Comments
Hi @strager, I'd like to work on this issue, can you please assign this to me |
@TonyBhargav Are you still working on this task? |
@strager Hi, I would like to work on this issue but I could not find the |
@msharipov quick-lint-js/src/quick-lint-js/util/integer.cpp Lines 130 to 132 in 6179ffc
|
@strager I claim this for-hire task. I expect payment after I complete this task. I will email the quick-lint-js team if I am assigned this task. |
@strager So, I've looked into this issue and I don't see a way to refactor it in a manner that would improve the performance and reduce the size of the compiled binaries. There are two problems:
Here's what I came up with:
Though I doubt that the new code is faster, I haven't run the benchmarks yet. Also, this results in the size of binaries increasing by about 7-10KB each:
|
@msharipov Thanks for the research!
Ah, good points. We could work around the lack of wchar_t support by copying the wchar_t string into a char array. But that feels gross...
Yeah, these differences are dealbreakers. simdjson's
(Note for posterity: We should compare the size of optimized, statically linked builds created by CI. You can create a pull request and download the files at I think the right thing to do is to keep our implementation and not reuse simdjson's implementation. @msharipov I consider this task complete to my liking. 👍 |
quick-lint-js/port/integer.cpp contains implementations for
from_chars
functions. These functions either usestd::from_chars
orstd::strtol
or a manual (slow) implementation.We already use simdjson. We should try using simdjson's
parse_unsigned
andparse_integer
functions instead. This might improve performance, but more importantly, it might reduce binary size.The text was updated successfully, but these errors were encountered: