Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable MessageLoop implementation by default #16408

Merged
merged 1 commit into from Sep 5, 2019

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Aug 15, 2019

This disables the RAF scheduler impl in favor of the MessageLoop one, which we've found better utilizes CPU. Unlike #16271, this keeps the RAF implementation for now just in case, but it's only in one specially marked test.

This matches what we already rolled out in www, except the rAF-specific flags (they're true on www but they're dead code in the rAF path anyway — and I didn't want to adjust the test for them).

My previous PR includes most of the extra test coverage for ML scheduler which I picked up from Andrew's earlier PR.

@sizebot
Copy link

sizebot commented Aug 15, 2019

React: size: -2.3%, gzip: -3.1%

Details of bundled changes.

Comparing: 868d02d...d61c6cc

react

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react.development.js -0.0% -0.0% 112.65 KB 112.65 KB 28.84 KB 28.84 KB UMD_DEV
react.production.min.js -2.3% -3.1% 12.64 KB 12.35 KB 5.02 KB 4.87 KB UMD_PROD
react.profiling.min.js -2.2% -2.8% 14.82 KB 14.5 KB 5.56 KB 5.4 KB UMD_PROFILING
react.development.js 0.0% -0.0% 72 KB 72 KB 18.93 KB 18.93 KB NODE_DEV
react.production.min.js 0.0% -0.1% 6.66 KB 6.66 KB 2.77 KB 2.77 KB NODE_PROD
React-dev.js 0.0% -0.0% 69.97 KB 69.97 KB 18.01 KB 18.01 KB FB_WWW_DEV
React-prod.js 0.0% -0.0% 17.32 KB 17.32 KB 4.53 KB 4.53 KB FB_WWW_PROD
React-profiling.js 0.0% -0.0% 17.32 KB 17.32 KB 4.53 KB 4.53 KB FB_WWW_PROFILING

scheduler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
scheduler-unstable_mock.development.js 0.0% -0.0% 16.71 KB 16.71 KB 4.1 KB 4.1 KB UMD_DEV
scheduler-tracing.profiling.min.js 0.0% -0.1% 3.25 KB 3.25 KB 992 B 991 B NODE_PROFILING
scheduler-unstable_mock.production.min.js 0.0% -0.0% 4.73 KB 4.73 KB 1.98 KB 1.98 KB UMD_PROD
Scheduler-dev.js -0.4% -0.1% 26.23 KB 26.11 KB 6.95 KB 6.94 KB FB_WWW_DEV
Scheduler-prod.js -21.3% -15.2% 15.92 KB 12.54 KB 3.59 KB 3.05 KB FB_WWW_PROD
scheduler-tracing.development.js 0.0% -0.0% 11.59 KB 11.59 KB 2.98 KB 2.98 KB NODE_DEV
scheduler-tracing.production.min.js 0.0% -0.3% 728 B 728 B 382 B 381 B NODE_PROD
scheduler-unstable_mock.development.js 0.0% -0.0% 16.52 KB 16.52 KB 4.04 KB 4.04 KB NODE_DEV
scheduler-unstable_mock.production.min.js 0.0% -0.1% 4.72 KB 4.72 KB 1.92 KB 1.92 KB NODE_PROD
SchedulerMock-dev.js -1.5% -1.3% 17.05 KB 16.8 KB 4.16 KB 4.11 KB FB_WWW_DEV
scheduler.development.js -0.0% 0.0% 25.63 KB 25.63 KB 6.84 KB 6.84 KB NODE_DEV
scheduler.production.min.js -5.7% -7.1% 5.23 KB 4.93 KB 2.15 KB 1.99 KB NODE_PROD

Generated by 🚫 dangerJS

@sebmarkbage
Copy link
Collaborator

Maybe we need to make sure this works on RN now?

@acdlite
Copy link
Collaborator

acdlite commented Sep 4, 2019

Let's go ahead and merge this?

@gaearon
Copy link
Collaborator Author

gaearon commented Sep 5, 2019

Lemme check RN. What are we looking for? Just that effects fire?

@sizebot
Copy link

sizebot commented Sep 5, 2019

React: size: -2.2%, gzip: -2.8%

Details of bundled changes.

Comparing: 79e46b6...1773240

react

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react.development.js -0.0% 0.0% 119.56 KB 119.56 KB 30.27 KB 30.27 KB UMD_DEV
react.production.min.js -2.2% -2.8% 12.71 KB 12.43 KB 5.04 KB 4.9 KB UMD_PROD
react.profiling.min.js -1.8% -2.6% 16.11 KB 15.83 KB 6.05 KB 5.9 KB UMD_PROFILING
react.development.js 0.0% -0.0% 73.12 KB 73.12 KB 19.25 KB 19.25 KB NODE_DEV
react.production.min.js 0.0% -0.0% 6.69 KB 6.69 KB 2.78 KB 2.78 KB NODE_PROD
React-dev.js 0.0% -0.0% 71.18 KB 71.18 KB 18.31 KB 18.31 KB FB_WWW_DEV
React-prod.js 0.0% 0.0% 17.41 KB 17.41 KB 4.55 KB 4.56 KB FB_WWW_PROD
React-profiling.js 0.0% 0.0% 17.41 KB 17.41 KB 4.55 KB 4.56 KB FB_WWW_PROFILING

scheduler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
scheduler-unstable_mock.development.js 0.0% -0.0% 22.12 KB 22.12 KB 5.13 KB 5.13 KB UMD_DEV
scheduler-tracing.profiling.min.js 0.0% -0.1% 3.25 KB 3.25 KB 994 B 993 B NODE_PROFILING
scheduler-unstable_mock.production.min.js 0.0% -0.1% 4.73 KB 4.73 KB 1.98 KB 1.98 KB UMD_PROD
Scheduler-dev.js -0.4% -0.1% 31.87 KB 31.76 KB 8 KB 7.99 KB FB_WWW_DEV
Scheduler-prod.js -21.1% -15.1% 15.99 KB 12.61 KB 3.61 KB 3.06 KB FB_WWW_PROD
Scheduler-profiling.js -17.2% -12.6% 19.62 KB 16.24 KB 4.3 KB 3.76 KB FB_WWW_PROFILING
scheduler-tracing.development.js 0.0% 0.0% 11.72 KB 11.72 KB 3.03 KB 3.03 KB NODE_DEV
scheduler-unstable_mock.production.min.js 0.0% -0.1% 4.72 KB 4.72 KB 1.92 KB 1.92 KB NODE_PROD
SchedulerMock-dev.js -1.1% -1.0% 22.5 KB 22.25 KB 5.21 KB 5.15 KB FB_WWW_DEV
scheduler.development.js -0.0% 0.0% 31.26 KB 31.26 KB 7.88 KB 7.89 KB NODE_DEV
scheduler.production.min.js -5.4% -7.4% 5.29 KB 5 KB 2.16 KB 2 KB NODE_PROD

Generated by 🚫 dangerJS against 1773240

@gaearon gaearon merged commit 040ca0f into facebook:master Sep 5, 2019
@gaearon
Copy link
Collaborator Author

gaearon commented Sep 5, 2019

I tested on RN a bit. useEffect works.
The fallback implementation is the same with or without the flag, so that should be fine.

@gaearon gaearon deleted the enable-ml branch September 5, 2019 18:29
@brunolemos
Copy link

that should be fine

famous last words 😄

@phaistonian
Copy link

Is this change published on the latest or any of the pre-releases?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants