3 ms·
Are you sure compilation is the bottleneck? 2.5s seems way too much by an order of magnitude. Have you looked into compiling during your build step instead of
by cheapsteak 10y ago
Are you sure compilation is the bottleneck? 2.5s seems way too much by an order of magnitude.
Have you looked into compiling during your build step instead of at runtime?
- underwater 10y agoIn a large application my rule of thumb is 1/3 compile, 1/3 React internals (which includes DOM updates) and 1/3 product code. 2.5 seconds is a lot, but not surprising if an application is being shipped as a multi-megabyte bundle. Compiling as a build step doesn't get you very far when you are forced to ship source code to JS engines.
- cheapsteak 10y agoI guess I may be a bit confused on what he meant by compilation Since JS is JIT compiled, I assumed perhaps he was delivering his scripts in raw JSX+ES6 and transpiling at runtime via babel's browser.js (as shown by react's Getting Started guide) [1]. If he meant time spent parsing the JS then I'd be a bit suspicious about the 2.5s both because of the extraordinary length and also I find it hard to believe someone who would know how to measure parse time would mistake the term with compilation. [1]: https://facebook.github.io/react/docs/getting-started.html https://facebook.github.io/react/docs/getting-started.html