Use the is_utf8 library - #109
Merged
Merged
Conversation
lpinca
force-pushed
the
use/is_utf8
branch
2 times, most recently
from
December 29, 2022 20:40
aac4a5d to
41256ab
Compare
|
I think websockets has a threshold: it only calls the fast utf-8-validate for sizeable strings. I suspect that if you greatly accelerate utf-8-validate, the threshold should be lowered. That is, it begins to pay to include smaller strings because despite the call overhead, the high processing speed should even things out. It should be 'easy' to benchmark. |
Member
Author
|
Do you mean https://github.com/websockets/ws/blob/d412358ccb5320bc00c8993ecd5d9b992df0753e/lib/validation.js#L120? If so, yes I plan to revisit the threshold when this lands. |
|
That’s correct. The threshold is probably necessary because of the function call overhead. |
Use the is_utf8 [1] library to greatly improve performance. [1]: https://github.com/simdutf/is_utf8
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use the is_utf8 library to greatly improve performance.
Supersedes #101.