Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(sourcemap): lazy compute decoded mappings
By deferring the decoding of the sourcemap mappings field, we can avoid extra computation and garbage generation, both of which appear to save a significant amount of time. In my test application (using vite), I saw a reduction in total build time of about 28.4%, and a reduction in peak heap size of 19.6% (706 MB) Project Info: * Node: v18.17.0 * Vite v4.4.7 * Rollup v3.26.3 * Module Count: 5490 modules transformed * Chunk Count: 54 chunks rendered Before: * Average vite build time (5 runs): 30.89 seconds * Average peak heap size (5 runs): 3594.83 MB * Time spent in GC: ~13.7 seconds * Time spent in `decode()`: 3.11 seconds After: * Average vite build time (5 runs): 22.13 seconds * Average peak heap size (5 runs): 2888.2 MB * Time spent in GC: ~5.9 seconds * Time spent in `decode()`: 1.70 seconds
- Loading branch information