Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement module-level memoization of inlined requires (#1346)
Summary: Pull Request resolved: #1346 A performance optimisation for `inlineRequries`, where we replace `const foo = require('./foo')` at top level with `var foo`, and replace subsequent references to `foo` with `(foo || foo = require('./foo')`. This differs from plain `inlineRequires` by the use of the memo variable, which (for modules that don't return a falsy value) saves calling into `require`, backed by `metroRequire`, and retrieving the previously-initialised module from a `Map` by its numeric ID. ``` - **[Experimental]:** Implement `transformer.unstable_memoizeInlineRequires` to optimise inlined access. ``` Reviewed By: javache Differential Revision: D62125134 fbshipit-source-id: 1ddbd8051d4a00b0ec358be8838f43eb8b0144a0
- Loading branch information