oxc-project
oxc
BlogDocsChangelog

Performance History

Latest Results

Merge main into mert/feat/add-loc-field-support and resolve conflicts
mertcanaltin:mert/feat/add-loc-field-support
43 minutes ago
fix(napi/parser): move `ExportEntry::module_request` field to first
12-02-fix_napi_parser_move_exportentry_module_request_field_to_first
1 hour ago
fix(napi/parser): move `ExportEntry::module_request` field to first
12-02-fix_napi_parser_move_exportentry_module_request_field_to_first
1 hour ago
fix(napi/parser): move `ExportEntry::module_request` field to first
12-02-fix_napi_parser_move_exportentry_module_request_field_to_first
2 hours ago
perf(linter): use `SmallVec` for rule options (#16400) Optimizes memory allocation for linter rule options by replacing `Option<Vec<serde_json::Value>>` with `SmallVec<[serde_json::Value; 1]>`. Most rules have 0-1 configuration options, so this avoids heap allocations in the common case while eliminating the invalid `Some(vec![])` state. ## Changes - Changed `ESLintRule.config` and `ExternalPluginStore.options` to use `SmallVec<[serde_json::Value; 1]>` - Enabled `serde` feature for `smallvec` workspace dependency - Updated parsing, serialization, and usage sites to use `is_empty()` instead of `is_none()` - Moved empty check logic into `ExternalPluginStore::add_options` method Fixes #16398 <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Linter: Use `SmallVec` for storing rule options</issue_title> > <issue_description>Rule options (defined in configs) are stored as `Option<Vec<serde_json::Value>>`. > > * `None` = No options. > * `Some` = 1 or more options. > > Note: `Some` containing an empty `Vec` is illegal (though that's not enforced by type system, which is unfortunate). > > https://github.com/oxc-project/oxc/blob/3f3d646280340bd4851e74297dca6d6a68b8466b/crates/oxc_linter/src/config/rules.rs#L50-L61 > > It's rare for a rule to have multiple options, so `config` field is very commonly `None` or `Some` containing a `Vec` with a single entry. We can optimize for the common cases by using `SmallVec` instead (from [smallvec](https://docs.rs/smallvec) crate). > > ```diff > - pub config: Option<Vec<serde_json::Value>>, > + pub config: SmallVec<[serde_json::Value; 1]>, > ``` > > This would reduce allocations. > > Note: I suggest we also remove the `Option` for 2 reasons: > > 1. It makes it impossible to have `Some` containing an empty `Vec` - more type safe. > > 2. The one advantage that `Option<Vec>` has is that creating `Option::None` is only 1 x `usize` memory write, whereas creating a `Vec` is 3 x `usize` writes. But this isn't true with `SmallVec` - creating an empty `SmallVec` is also only 1 x `usize` write. So once we switch to `SmallVec`, the advantage of the `Option` disappears.</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> - Fixes oxc-project/oxc#16398 <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: overlookmotel <557937+overlookmotel@users.noreply.github.com> Co-authored-by: overlookmotel <theoverlookmotel@gmail.com>
main
2 hours ago

Active Branches

feat(ast): add loc field support for AST nodes
last run
43 minutes ago
#13285
CodSpeed Performance Gauge
-44%
#16344
CodSpeed Performance Gauge
0%
#16320
CodSpeed Performance Gauge
0%
© 2025 CodSpeed Technology
Home Terms Privacy Docs