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

Make NoWork big instead of small #13904

Closed
wants to merge 2 commits into from
Closed

Conversation

sophiebits
Copy link
Collaborator

Look at all the code we don't need!

Ran these, then prettier, then these again.

```
codemod --accept-all -d packages -m '\(\s*([a-zA-Z.]+) === NoWork\s*\|\|\s*\1 (>=?) ([a-zA-Z.]+)\s*\)' '(\1 \2 \3)'
codemod --accept-all -d packages -m '\(\s*([a-zA-Z.]+) === NoWork\s*\|\|\s*([a-zA-Z.]+) (<=?) \1\s*\)' '(\2 \3 \1)'

codemod --accept-all -d packages -m '(?<![.\w])([a-zA-Z.]+) !== NoWork\s*&&\s*\1 (<) ([a-zA-Z.]+)' '\1 \2 \3'
codemod --accept-all -d packages -m '(?<![.\w])([a-zA-Z.]+) !== NoWork\s*&&\s*([a-zA-Z.]+) (>) \1' '\2 \3 \1'

codemod --accept-all -d packages -m '(?<![.\w])([a-zA-Z.]+) === NoWork\s*\|\|\s*\1 (>=?) ([a-zA-Z.]+)\s*\?\s' '\1 \2 \3 ? '
codemod --accept-all -d packages -m '(?<![.\w])([a-zA-Z.]+) === NoWork\s*\|\|\s*([a-zA-Z.]+) (<=?) \1\s*\?\s' '\2 \3 \1 ? '
```
@sizebot
Copy link

sizebot commented Oct 20, 2018

ReactDOM: size: 🔺+0.3%, gzip: -0.2%

Details of bundled changes.

Comparing: 7268d97...93e0bdf

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js -0.2% -0.1% 677.05 KB 675.72 KB 157.31 KB 157.13 KB UMD_DEV
react-dom.production.min.js 🔺+0.3% -0.2% 97.43 KB 97.69 KB 31.83 KB 31.77 KB UMD_PROD
react-dom.development.js -0.2% -0.1% 672.39 KB 671.06 KB 155.91 KB 155.74 KB NODE_DEV
react-dom.production.min.js 🔺+0.3% -0.2% 97.45 KB 97.71 KB 31.39 KB 31.33 KB NODE_PROD
ReactDOM-dev.js -0.3% -0.1% 690.36 KB 688.45 KB 156.64 KB 156.41 KB FB_WWW_DEV
ReactDOM-prod.js -0.3% -0.3% 293.6 KB 292.82 KB 53.94 KB 53.79 KB FB_WWW_PROD
react-dom.profiling.min.js +0.2% -0.2% 99.85 KB 100.08 KB 31.75 KB 31.7 KB NODE_PROFILING
ReactDOM-profiling.js -0.4% -0.4% 298.01 KB 296.94 KB 54.99 KB 54.79 KB FB_WWW_PROFILING
react-dom.profiling.min.js +0.2% -0.1% 99.78 KB 100 KB 32.27 KB 32.22 KB UMD_PROFILING

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js -0.3% -0.2% 464.5 KB 463.11 KB 103.11 KB 102.95 KB UMD_DEV
react-art.production.min.js 🔺+0.2% -0.1% 89.39 KB 89.59 KB 27.48 KB 27.45 KB UMD_PROD
react-art.development.js -0.4% -0.2% 396.28 KB 394.89 KB 86.01 KB 85.83 KB NODE_DEV
react-art.production.min.js 🔺+0.3% -0.4% 54.37 KB 54.55 KB 16.75 KB 16.69 KB NODE_PROD
ReactART-dev.js -0.5% -0.3% 400.62 KB 398.64 KB 84.5 KB 84.26 KB FB_WWW_DEV
ReactART-prod.js -0.5% -0.6% 166.81 KB 166.02 KB 28.26 KB 28.09 KB FB_WWW_PROD

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer.development.js -0.3% -0.2% 409.75 KB 408.36 KB 88.85 KB 88.67 KB UMD_DEV
react-test-renderer.production.min.js 🔺+0.4% -0.3% 55.83 KB 56.03 KB 17.13 KB 17.07 KB UMD_PROD
react-test-renderer.development.js -0.3% -0.2% 405.32 KB 403.93 KB 87.74 KB 87.57 KB NODE_DEV
react-test-renderer.production.min.js 🔺+0.4% -0.3% 55.54 KB 55.74 KB 16.91 KB 16.85 KB NODE_PROD
ReactTestRenderer-dev.js -0.5% -0.3% 410 KB 408.02 KB 86.59 KB 86.34 KB FB_WWW_DEV

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js -0.3% -0.2% 393.98 KB 392.65 KB 84.45 KB 84.27 KB NODE_DEV
react-reconciler.production.min.js 🔺+0.5% -0.3% 55.41 KB 55.67 KB 16.56 KB 16.51 KB NODE_PROD
react-reconciler-persistent.development.js -0.3% -0.2% 392.59 KB 391.25 KB 83.9 KB 83.72 KB NODE_DEV
react-reconciler-persistent.production.min.js 🔺+0.5% -0.3% 55.42 KB 55.68 KB 16.57 KB 16.51 KB NODE_PROD

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js -0.4% -0.2% 527.22 KB 525.31 KB 115.49 KB 115.23 KB RN_FB_DEV
ReactNativeRenderer-prod.js -0.3% -0.4% 221.6 KB 220.94 KB 38.59 KB 38.43 KB RN_FB_PROD
ReactNativeRenderer-dev.js -0.4% -0.2% 526.93 KB 525.02 KB 115.41 KB 115.15 KB RN_OSS_DEV
ReactNativeRenderer-prod.js -0.3% -0.4% 221.61 KB 220.95 KB 38.59 KB 38.43 KB RN_OSS_PROD
ReactFabric-dev.js -0.4% -0.2% 517.44 KB 515.54 KB 113.06 KB 112.81 KB RN_FB_DEV
ReactFabric-prod.js -0.3% -0.4% 216.18 KB 215.51 KB 37.33 KB 37.18 KB RN_FB_PROD
ReactFabric-dev.js -0.4% -0.2% 517.48 KB 515.57 KB 113.07 KB 112.82 KB RN_OSS_DEV
ReactFabric-prod.js -0.3% -0.4% 216.21 KB 215.55 KB 37.35 KB 37.19 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js -0.4% -0.5% 227.21 KB 226.41 KB 39.96 KB 39.76 KB RN_OSS_PROFILING
ReactFabric-profiling.js -0.4% -0.6% 220.95 KB 220.01 KB 38.65 KB 38.43 KB RN_OSS_PROFILING
ReactNativeRenderer-profiling.js -0.4% -0.5% 227.2 KB 226.39 KB 39.96 KB 39.76 KB RN_FB_PROFILING
ReactFabric-profiling.js -0.4% -0.6% 220.91 KB 219.97 KB 38.64 KB 38.41 KB RN_FB_PROFILING

scheduler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
scheduler.development.js n/a n/a 0 B 19.17 KB 0 B 5.74 KB UMD_DEV
scheduler.production.min.js n/a n/a 0 B 3.16 KB 0 B 1.53 KB UMD_PROD

Generated by 🚫 dangerJS

@sophiebits
Copy link
Collaborator Author

bigger?! I guess we inline 1073741823 a bunch of times?

@sophiebits
Copy link
Collaborator Author

Probably could change Closure hereabouts if we wanted to not inline it every time. But maybe that's slow. https://github.com/google/closure-compiler/blob/85643a17293ac09253dcf8017404136d28942fc4/src/com/google/javascript/jscomp/InlineVariables.java#L725

@sebmarkbage
Copy link
Collaborator

sebmarkbage commented Oct 21, 2018

I think I would prefer the inverse and start the timer at the max int going backwards.

That speaks to the notion of higher “priority” being a higher number. We always end up having to say “higher, and by higher I mean lower number”. Would be nicer to just talk about priority.

That would leave NoWork being falsy which is a nice property. Offscreen pri gets a nice expressable number. And it would solve the file size issue.

@sophiebits
Copy link
Collaborator Author

#13912

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.

4 participants