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
Benchmarks Against SWC? #86
Comments
Currently i don't have concrete benchmarks because i am still developing and optimizing the parser, however, i know it performs about as fast as swc's parser, going faster or slower depending on file size. This is pretty much expected because swc produces a basic AST, rslint's parser produces events which are then converted to a (lossless!) tree. Event processing is relatively slow therefore the parser is a lot slower on large files than it is on moderately sized files. As for the lexer, it is significantly faster than swc's lexer, mostly because it relies on byte-based lexing, while swc is based on chars. You also need to consider the fact that rslint's parser is error tolerant and lossless, both of which add some complexity, memory usage, and overhead. Overall, id say if you don't need error tolerance and losslessness and just need an AST, use swc, it doesnt have any memory overhead and has much less bugs. Also, swc supports jsx while rslint currently doesn't. |
So rslint is more for actual stuff like linting and static analysis while SWC is better for just AST manipulation? |
Pretty much, swc is fantastic for AST manipulation and "abstract" operations because it has things like AST -> str already, additionally, rslint's rowan tree is a bit awkward to mutate (since it is immutable to allow for easy sharing). However rslint excels at static analysis and analyzing the raw tree and things like whitespace, its also error tolerant which is nice. |
Hi,
This looks like a really cool project and I am wondering if you have benchmarks of your parser against SWC.
The text was updated successfully, but these errors were encountered: