Add NodeJS parser to benchmarks.
Previous attempt #2724 did not work due CodSpeed producing very
inaccurate results (https://github.com/CodSpeedHQ/action/issues/96).
This version runs the actual benchmarks without CodSpeed's
instrumentation. Then another faux-benchmark runs within Codspeed's
instrumented action and just performs meaningless calculations in a loop
for as long as is required to take same amount of time as the original
uninstrumented benchmarks took.
It's unfortunate that we therefore don't get flame graphs on CodSpeed,
but this seems to be the best we can do for now.
Rule detail:
https://eslint.org/docs/latest/rules/no-template-curly-in-string
At first I implemented it with regex, but I think you are trying to
avoid it for performance reasons, so I did it by searching for the
chars.
I had some problems showing the span in the case of 'Hello, ${{foo:
"bar"}.foo}' I think it turned out more or less well, however, if you
think it can be done in another way I am willing to do it .
---------
Co-authored-by: j.buendia <j.buendia>
As talked here
https://github.com/oxc-project/oxc/pull/2746#discussion_r1528145418
errors in guard_for_in could be improved so I attempted to improve it.
If anyone have a suggestion for the span element positions say me!
---------
Co-authored-by: j.buendia <j.buendia>
Rule detail: https://eslint.org/docs/latest/rules/max-params
Maybe I can add function name, I was searching for it, but I don't know
how to get it.
---------
Co-authored-by: j.buendia <j.buendia>
#2751 contained a mistake, which was pointed out by Adrian @ CodSpeed on
Discord.
For PRs from forks, `CODSPEED_TOKEN` is not provided, and the submission
to CodSpeed is "tokenless". #2751 wrongly assumed all runs are submitted
with a token. This PR fixes that.
Speed up lexing JSX identifier continuations (i.e. after `-`), by
searching for end of identifier byte-by-byte.
Change does not register on benchmarks, only because benchmarks don't
contain any `<Foo-Bar />` identifiers, so don't exercise this code path.
Follow-on from #2751. Further shards linter benchmarks so each fixture runs in its own job.
This reduces total time to run benchmarks by another ~75 secs. So approx 2.5 mins shaved off in total.
This PR shards benchmarks when running on CI. Each benchmark (parser, minifier etc) runs as a separate job, and then a final job combines the results and uploads to Codspeed.
A bit of a hacky implementation. Uses a small NodeJS HTTP server to intercept the results from `codspeed-runner`, and then another NodeJS script to combine them all together, and upload to CodSpeed.
I will submit PRs on Codspeed's runner + action to do it properly, but as I imagine it'll be a slow process getting that merged upstream, I wanted to see if it worked first. We can replace this once it's supported upstream.
Sharding only reduces total time to run the benchmarks by about 70 secs at present, because linter benchmark takes 6 mins alone and holds up the whole process (all the rest are done in ~2 mins). If we can split up the linter benchmark, we can likely get total run time down to around 3 mins. I'll try that in a follow-on PR.
I guess the other upside is we can now add as many benchmarks as we like with impunity - they'll run in parallel, and so won't slow things down overall.
Rule detail: https://eslint.org/docs/latest/rules/no-continue
It's my first time in Rust, so I have a lot to learn from you. Maybe I
do some silly mistakes. Sorry!
---------
Co-authored-by: j.buendia <j.buendia>
#2724 added CodSpeed benchmarks for NodeJS `oxc-parser`.
Unfortunately it turns out CodSpeed's results are wildly inaccurate.
Unclear why, but have raised an issue with CodSpeed
(https://github.com/CodSpeedHQ/action/issues/96). In meantime it seems
best to remove the benchmarks as they're not useful at present.
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.
This pr is to add a new return value: `local`, which current property
`name` always return `expect` and the `local` property will return its
alias name for the following example:
```js
import { expect as JEST_EXPECT } from '@jest/globals';
```
and the `jest_expect_fn_call.name` will return `expect` and the
`jest_expect_fn_call.local` wil return `JEST_EXPECT`.
This PR merges the previous confusing features `serde` and `wasm` into a
single `serialize` feature.
We'll eventually do serialize + type information for both wasm and napi
targets.
`oxc_macros` is removed from `oxc_ast`'s dependency because it requires
`syn` and friends, which goes against our policy ["Third-party
dependencies should be
minimal."](https://oxc-project.github.io/docs/contribute/rules.html#development-policy)