Skip to content

Commit

Permalink
feat(perf): use lazy module evaluation (react-native-community#152)
Browse files Browse the repository at this point in the history
Summary:
---------

After react-native-community#150 (thanks @sidferreira and @Trancever) we're finally able to use lazy module evaluation for additional perf! 

Before:
```
0.70 real         0.64 user         0.12 sys
```
After:
```
0.19 real         0.16 user         0.03 sys
```

Which gives us roughly 0.5s (~72%) improvement in startup time. With 0.2s startup time most commands feel instant now.

Test Plan:
----------

No new tests added.
  • Loading branch information
thymikee authored Feb 6, 2019
1 parent b2a6359 commit 9a45766
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@ module.exports = {
],
require.resolve('@babel/preset-flow'),
],
plugins: [require.resolve('@babel/plugin-transform-strict-mode')],
plugins: [
require.resolve('@babel/plugin-transform-strict-mode'),
[
require.resolve('@babel/plugin-transform-modules-commonjs'),
{ lazy: true },
],
],
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"dependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-transform-modules-commonjs": "^7.2.0",
"@babel/plugin-transform-strict-mode": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-flow": "^7.0.0",
Expand Down

0 comments on commit 9a45766

Please sign in to comment.