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

Added a webpack benchmark: the basic output of create-react-app. #34

Merged
merged 1 commit into from
Oct 31, 2016

Conversation

aickin
Copy link
Collaborator

@aickin aickin commented Oct 29, 2016

This PR adds the unminified output of create-react-app as a benchmark script, as a good example of webpack output.

On master I get:

create-react-app.js: 29.91ms
create-react-app.optimized.js: 29.68ms
create-react-app.min.js: 20.87ms
create-react-app.min.optimized.js: 20.58ms

On aickin/optimize-js webpack-specific branch, I get:

create-react-app.js: 29.33ms
create-react-app.optimized.js: 6.47ms
create-react-app.min.js: 20.06ms
create-react-app.min.optimized.js: 6.63ms

One really bad thing about this PR is that the "Run all" button in the benchmark now consistently crashes Chrome for me part way through the benchmark. Each benchmark is still individually runnable, but if you try to run all of them, it crashes. I don't know what to do about that.

In case you want to re-create this file at some point, I did the following to generate the benchmark file:

  • Used create-react-app to make a new project.
  • npm run eject
  • Removed UglifyPlugin from config/webpack.config.prod.js
  • Modified src/index.js, removing the call ReactDOM.render and replacing it with:
window.React = React;
window.ReactDOM = ReactDOM;
window.app = <App />;
  • npm run build
  • Copy build/static/js/main.<hash>.js to this benchmark folder as create-react-app.js.
  • Add the __start and __end benchmarking lines from the other benchmarks to the top and bottom of the file.

@nolanlawson
Copy link
Owner

I'm guessing Chrome crashes because of a memory leak, but I'm still happy to merge this because it looks like a great test case. Thank you!

@nolanlawson nolanlawson merged commit 94a5714 into nolanlawson:master Oct 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants