This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(experimental): use DrainOuterGeneric helper on codec type ma…
…ppings (#2322) This PR aims to solve #2295 by wrapping codec type mappings with the suggested `DrainOuterGeneric`. The TypeScript diagnostics on a complex codec — using both data enums and structs — changes as follows. As you can see we get a significant reduction of instantiations. ``` Files: 204 -> 205 Lines of Library: 38131 -> 38131 Lines of Definitions: 52284 -> 52300 Lines of TypeScript: 81 -> 81 Lines of JavaScript: 0 -> 0 Lines of JSON: 0 -> 0 Lines of Other: 0 -> 0 Identifiers: 92492 -> 92518 Symbols: 111465 -> 111877 Types: 55305 -> 55390 Instantiations: 603991 -> 362113 // -40% Memory used: 187111K -> 189767K Assignability cache size: 21397 -> 21404 Identity cache size: 350 -> 350 Subtype cache size: 161 -> 161 Strict subtype cache size: 358 -> 354 I/O Read time: 0.01s -> 0.01s Parse time: 0.18s -> 0.18s ResolveModule time: 0.02s -> 0.02s ResolveTypeReference time: 0.00s -> 0.00s ResolveLibrary time: 0.01s -> 0.01s Program time: 0.23s -> 0.24s Bind time: 0.07s -> 0.07s Check time: 0.78s -> 0.72s transformTime time: 0.00s -> 0.00s commentTime time: 0.00s -> 0.00s I/O Write time: 0.00s -> 0.00s printTime time: 0.01s -> 0.01s Emit time: 0.01s -> 0.01s Total time: 1.09s -> 1.04s ```
- Loading branch information