-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only create TurboModules, if they're registered (#37032)
Summary: Pull Request resolved: #37032 Before, calling into global.turboModuleProxy would kickstart the module creation algorithm, **even if the module wasn't registered.** Now, if the module isn't registered, TurboModuleManager will just early return null. NOTE: When an unregistered module is requested from Java via TurboModuleManager.getModule(moduleName), the module algorithm will **still** run. This fixes a bug: - global.**native**ModuleProxy will no longer kickstart **turbo** module creation. - global.**turbo**ModuleProxy will no longer kickstart **legacy** module creation. NOTE: This **might** improve fb4a performance **a bit**: The TurboModule creation algorithm is *probably* expensive to run. 44 NativeModules are loaded at startup by Fb4a; 8 of them aren't registered with the app: [pastry](https://www.internalfb.com/phabricator/paste/view/P701125588?lines=2%2C4%2C5%2C7%2C9%2C16%2C18%2C24). Those 8 NativeModule creates will now shortcircuit to null faster. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D45195578 fbshipit-source-id: cb09bdc059b3651b02447b7c2e37ef3f4ca2f92b
- Loading branch information
1 parent
215e574
commit af5c2d2
Showing
3 changed files
with
72 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters