` while the component is loading. Once the component is loaded and ready to use, the `
` will be replaced with the actual component. `const NebulaDeferred = deferred( import("/components/nebula").then(m => m.default) ); return ( // ...
} loaded={Nebula => } />
);` With all of this in place, we reduced our `index.html` to a mere 20 KB, less than half of the original size. What effect does this have on FMP and TTI? WebPageTest will tell!
The filmstrip confirms: Our TTI is now at 5.4s. A drastic improvement from our original 11s.
Our FMP and TTI are only 100ms apart, as it is only a matter of parsing and executing the inlined JavaScript. After just 5.4s on 2G, the app is completely interactive. All the other, less essential modules are loaded in the background. More Sleight of Hand If you look at our list of critical modules above, you'll see that the rendering engine is not part of the critical modules. Of course, the game cannot start until we have our rendering engine to render the game. We could disable the "Start" button until our rendering engine is ready to start the game, but in our experience the user usually takes long enough to configure their game settings that this isn't necessary. Most of the time the rendering engine and the other remaining modules are done loading by the time the user presses "Start". In the rare case that the user is quicker than their network connection, we show a simple loading screen that waits for the remaining modules to finish. Conclusion Measuring is important. To avoid spending time on problems that are not real, we recommend to always measure first before implementing optimizations. Additionally, measurements should be done on *real* devices on a 3G connection or on [WebPageTest](https://webpagetest.org/easy) if no real device is at hand. The filmstrip can give insight into how loading your app *feels* for the user. The waterfall can tell you what resources are responsible for potentially long loading times. Here's a checklist of things you can do to improve loading performance: Deliver as many assets as possible over one connection. [Preload](/preload-critical-assets) or even inline resources that are required for the first render and interactivity. Prerender your app to improve perceived loading performance. Make use of aggressive [code splitting](/reduce-javascript-payloads-with-code-splitting) to reduce the amount of code needed for interactivity. Stay tuned for part 2 where we discuss how to optimize runtime performance on hyper-constrained devices. Except as otherwise noted, the content of this page is licensed under the [Creative Commons Attribution 4.0 License](https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). For details, see the [Google Developers Site Policies](https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates. Last updated 2019-09-23 UTC.