Skip to content

refactor(tsconfig): skip TsConfig deep clone for non-root configs#1265

Merged
Boshen merged 1 commit into
mainfrom
refactor/tsconfig-clone
Jul 2, 2026
Merged

refactor(tsconfig): skip TsConfig deep clone for non-root configs#1265
Boshen merged 1 commit into
mainfrom
refactor/tsconfig-clone

Conversation

@Boshen

@Boshen Boshen commented Jul 2, 2026

Copy link
Copy Markdown
Member

Cache::get_tsconfig deep-cloned every parsed TsConfig before branching on root, but the clone only matters in the root branch, where TsConfig::build(mut self) consumes the value after the raw version is cached. On the non-root path — taken once per extends entry — the original local was dropped unused, so the clone (CompilerOptions, three Option<Vec<PathBuf>>s, references, paths) was pure waste.

The raw cache still stores the should_build = false version and the built cache still stores the built version; returned Arcs share the cached instances exactly as before.

Split out of #1263.

`get_tsconfig` deep-cloned every parsed `TsConfig` before branching,
but only the root branch needs the clone (because `build()` consumes
`self`). On the non-root path - taken once per `extends` entry - the
original was dropped unused. Move the config into the cached `Arc`
directly and clone only in the root branch.
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.85%. Comparing base (4837a2e) to head (e0a11b1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1265   +/-   ##
=======================================
  Coverage   93.85%   93.85%           
=======================================
  Files          21       21           
  Lines        4313     4314    +1     
=======================================
+ Hits         4048     4049    +1     
  Misses        265      265           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq

codspeed-hq Bot commented Jul 2, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 3.57%

❌ 2 regressed benchmarks
✅ 19 untouched benchmarks
⏩ 5 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
resolver_real[multi-thread] 249.5 µs 259.8 µs -3.98%
pm/pnpm-hoisted 1 ms 1.1 ms -3.15%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing refactor/tsconfig-clone (e0a11b1) with main (4837a2e)

Open in CodSpeed

Footnotes

  1. 5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Boshen
Boshen merged commit e66adb8 into main Jul 2, 2026
18 checks passed
@Boshen
Boshen deleted the refactor/tsconfig-clone branch July 2, 2026 07:30
@oxc-guard oxc-guard Bot mentioned this pull request Jul 2, 2026
Boshen pushed a commit that referenced this pull request Jul 2, 2026
## 🤖 New release

* `oxc_resolver`: 11.22.0 -> 11.23.0
* `oxc_resolver_napi`: 11.22.0 -> 11.23.0

<details><summary><i><b>Changelog</b></i></summary><p>

## `oxc_resolver`

<blockquote>

##
[11.23.0](v11.22.0...v11.23.0)
- 2026-07-02

### <!-- 0 -->🚀 Features

- *(tsconfig)* expose outDir, declarationDir, resolveJsonModule, checkJs
([#1257](#1257)) (by
@Boshen)

### <!-- 1 -->🐛 Bug Fixes

- *(exports)* propagate the last error in array target resolution
([#1267](#1267)) (by
@Boshen)

### <!-- 2 -->🚜 Refactor

- deduplicate cross-file helpers, drop stale lint allows
([#1269](#1269)) (by
@Boshen)
- *(dts)* deduplicate package entry selection and remove dead code
([#1266](#1266)) (by
@Boshen)
- *(tsconfig)* skip TsConfig deep clone for non-root configs
([#1265](#1265)) (by
@Boshen)
- *(alias)* compile fallback aliases once at construction
([#1264](#1264)) (by
@Boshen)

### <!-- 4 -->⚡ Performance

- *(alias)* scan a packed first-byte array instead of striding over
alias entries
([#1260](#1260)) (by
@Boshen)

### Contributors

* @Boshen
</blockquote>



</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: oxc-guard[bot] <276638029+oxc-guard[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant