Potential performance overhead in ts-loader's disabled resolver
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript, webpack
- Área
- backend, performance
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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?
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.5k
- Forks
- 439
- Merge medio
- 8 h 6 min
- PR fusionados (30 d)
- 12
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TypeStrong/ts-loader
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
TypeStrong/ts-loader#1709 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
rspack compatibilityPosiblemente ocupada @onigoetz la tomó hace 191 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
TypeStrong/ts-loader#1694 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
TypeStrong/ts-loader#1675 ·
Los mantenedores suelen responder en 1 día
-
typescript-native compilerAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
TypeStrong/ts-loader#1671 · 12 comentarios · 11 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
TypeStrong/ts-loader#1660 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de TypeStrong/ts-loader
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
danielmiessler/LifeOS#3028 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
iOS: last line of a long UITextView text is sometimes not drawn (frame a fraction of a point short)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
Koenkk/zigbee2mqtt#33855 ·
Los mantenedores suelen responder en 1 día