-
-
Notifications
You must be signed in to change notification settings - Fork 496
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
Benchmark NodeJS parser #2616
Comments
It seems like all we need to bench is the Benchmarking is node.js is notoriously unstable, I don't want to spend time on the node.js side :-) |
Somewhat. The overhead of NAPI-RS would be good to measure though. I wonder if, for instance, passing the JSON from Rust to JS as a buffer instead of a string would be faster. But mainly I'm thinking of #2457, which involves a lot of JS-side code for deserialization. To measure how effective that is, we would ideally benchmark the whole thing end-to-end (inc both JS and Rust). Understood you'd prefer to concentrate your efforts on Rust side. I get that! JS is messy. I'll look into it when I have time. I opened this issue mainly in case you might say "I've done this before. We should do X". |
Closes #2616. Adds benchmarks for NodeJS NAPI build. Measurement includes `JSON.parse` of the AST on JS side, since that's how it'll be used 99% of the time. Benchmarks run against same files as Rust parser benchmarks, so we can see the overhead of transferring AST to JS.
For #2457 and also the work around ESTree-izing the parser's JSON output, it'd be good to be benchmarking the NodeJS oxc-parser interface.
Any idea how we could go about this? CodSpeed says it supports NodeJS. But:
Should we create a separate set of benchmarks in CodSpeed for it, or try to get it added to the current list?
If NodeJS OXC parser is a primary performance target, it could be good to add it to main list, so we see any performance regressions/improvements on every commit, same as we do for the Rust interfaces.
A hacky way to do this would be:
Purpose of co-ordinating over stdin/stdout is avoid creating and destroying a NodeJS child process on each turn of the benchmark loop, as that overhead would be high, and not representative of real-world usage where typically you'd parse many files in a single NodeJS process.
But is there a better way than this?
The text was updated successfully, but these errors were encountered: