Potential performance overhead in ts-loader's disabled resolver
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript, webpack
- 領域
- backend, performance
調査の方向性
Start with src/resolver.ts and trace how servicesHost.resolveModule handles the resolver result and falls back to TypeScript. Compare the disabled resolver's behavior with the reported return false experiment, then check the existing tests for fallback and diagnostics. Done means avoiding per-call exception overhead while preserving fallback and diagnostic behavior.
索引モデルが issue の本文から書いたものです。
説明
Potential performance overhead in ts-loader's disabled resolver
Problem
In ts-loader v9.6.2, makeResolver returns a function that always throws. servicesHost.resolveModule catches the exception and continues with TypeScript's resolver. Could this disabled path avoid the exception overhead while preserving the existing fallback behavior?
This is a performance question, separate from the functional enhanced-resolve issue in #1492. PR #1701 notes that the resolver was already disabled before that change. This report does not propose restoring enhanced-resolve.
Measurements
I compared v9.6.2 with an experimental change that replaces throw new Error() in src/resolver.ts with return false. false is allowed by ResolveSync, and the caller continues to TypeScript's resolver. This is one possible implementation, not a proposed definitive fix.
In our private application, two local initial-build comparisons measured:
| Run | Existing configuration | Avoiding the resolver throw | Reduction |
|---|---|---|---|
| 1 | 73.4 s | 39.0 s | 34.4 s (46.9%) |
| 2 | 75.5 s | 43.1 s | 32.4 s (42.9%) |
The generated assets matched except for webpack's compilation hash in runtime.js. The application source and CPU profile are private, so these results are specific to our project and environment.
The published resolver-overhead reproduction fixture is generated and contains no application source. It was run with Node 24.14.1, TypeScript 6.0.3, and webpack 5.112.2. With 300 view modules and a resolution fan-out of 2,100, it produced 634,051 resolver calls per build. After one warmup, the median of three paired initial builds was:
| Resolver behavior | Median initial build |
|---|---|
| Throw and catch | 51.71 s |
| Return no result | 42.71 s |
Both modes reported zero errors and warnings and emitted byte-identical bundles. The fixture's dense import fan-out was chosen to approximate our call volume; these timings do not predict a general application-level speedup.
Correctness check
In a separate small transpileOnly: false watch fixture, both variants emitted byte-identical initial bundles and reported the same TS2322 diagnostic after a source change. These checks cover only the tested configuration.
Could the disabled resolver return no result, or use another approach, to avoid throwing on every call while preserving TypeScript fallback and diagnostics?
- 主要言語
- TypeScript
- スター
- 3.5k
- フォーク
- 439
- 平均マージ
- 8時間 6分
- マージ済み PR(30日)
- 12
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TypeStrong/ts-loader のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
TypeStrong/ts-loader#1709 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
rspack compatibility対応中かも @onigoetz が 191 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
TypeStrong/ts-loader#1694 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
TypeStrong/ts-loader#1675 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
TypeStrong/ts-loader#1671 · コメント 12 件 · リアクション 11 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
TypeStrong/ts-loader#1660 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
TypeStrong/ts-loader の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
danielmiessler/LifeOS#3028 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
iOS: last line of a long UITextView text is sometimes not drawn (frame a fraction of a point short)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
Koenkk/zigbee2mqtt#33855 ·
メンテナーはふだん 1 日以内に返信