-
Notifications
You must be signed in to change notification settings - Fork 197
Text encode decode #1645
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
Text encode decode #1645
Conversation
|
I'd like to benchmark this change |
|
One should create the encoder and the decoder only once and reuse it, and use a fixed buffer for |
Done |
|
@vouillon, any idea on how to benchmark this other that micro benchmarks ? |
9fea72f to
5499d77
Compare
5499d77 to
0e9dcba
Compare
0e9dcba to
7375672
Compare
|
A quick micro benchmark show a significant slowdown.
this PR
|
cae4138 to
9724287
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
runtime/js/mlBytes.js:642
- The function
caml_jsstring_of_stringshould handle non-ASCII strings correctly. The previous implementation usedcaml_utf16_of_utf8, which may handle edge cases differently thanTextDecoder.
if (jsoo_is_ascii(s)) return s;
runtime/js/mlBytes.js:659
- The function
caml_string_of_jsstringshould handle non-ASCII strings correctly. The previous implementation usedcaml_utf8_of_utf16, which may handle edge cases differently thanTextEncoder.
if (jsoo_is_ascii(s)) return caml_string_of_jsbytes(s);
9724287 to
85a321a
Compare
a4cf2ee to
55d1854
Compare
|
@vouillon, do you have any opinion on this ? |
f7e0d1e to
0d39b69
Compare
0d39b69 to
406d45d
Compare
Was this slowdown mitigated, or was the end decision to go with it? |
The slowdown should only affect non-ascii strings. |
|
I see. Thanks! |
No description provided.