Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear Babel Cache and avoid unnecessary AST clone
Summary: Improves the memory pressure and runtime-performance by cleaning the babel-cache and avoiding to clone the AST in the transformer. Clearing the babel cache is not strictly necessary because babel uses a `WeakMap` internally. However, we can help the GC since we know that the same AST nodes are no longer referenced (it's either a different file or the file gets reparsed, which results in new nodes). Before: https://pxl.cl/1s5nB After: https://pxl.cl/1s5nx Results for building the `MarketplaceHome.entrypoint` on my on-demand using a local metronome package with `--reset-cache` | | Run 1 | Run 2 | Run 3 | |--------|--------|--------|--------| | Before | 1m 17s | 1m 18s | 1m 19s | | After | 1m 14s | 1m 14s | 1m 13s | Reviewed By: cpojer Differential Revision: D25175301 fbshipit-source-id: 459074916d1c150a1767d245358e155e81a2661c
- Loading branch information