Open
Conversation
* tried my best to keep all comments * tried my best to keep the code structure similiar with the original JS code There are still some ways to improve the wasm tokenizer. I'm not sure in the original code `charCodeAt` will or won't exceed the length of the `source`. If the answer is not, some of the boundary checking code could be removed. If this WASM impl could be accepted, could you please publish the C code in the npm tarball? Therefore we could easily intergrate the tokenizer with our other part of C code. The reason why I rewrite the tokenizer is that we have to transform the style string on runtime in Browser for our cross platform rendering freamwork(https://github.com/lynx-family). Although the current css-tree's tokenizer is really fast, it still becomes one of a bottelneck of the rendering performance.
Author
|
awesome |
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.

#342
The build/bundle part should be modified by reviewers/maintainers.
There are still some ways to improve the wasm tokenizer. I'm not sure in the original code
charCodeAtwill or won't exceed the length of thesource. If the answer is not, some of the boundary checking code could be removed.If this WASM impl could be accepted, could you please publish the C code in the npm tarball? Therefore we could easily intergrate the tokenizer with our other part of C code.
The reason why I rewrite the tokenizer is that we have to transform the style string on runtime in Browser for our cross platform rendering freamwork(https://github.com/lynx-family). Although the current css-tree's tokenizer is really fast, it still becomes one of a bottelneck of the rendering performance.