Chapter 19. Metrics and code splitting

 

This chapter covers

  • Gathering statistics with lightweight metrics
  • Generating and understanding the GWT Compile Report
  • Using code splitting to decrease load times

Throughout this book we’ve covered everything you need to know to build massive GWT applications that will rival anything found on the desktop. But perhaps your massive application is a little too massive. Perhaps it feels slow and bloated. Perhaps you know that you need to optimize your application, but you aren’t sure exactly where to start.

You can break optimization into two parts. First, you need to be able to measure performance metrics, and then, based on these metrics, you’ll be able to dig into the code to target those parts that optimization benefits the most.

GWT provides two useful tools for understanding your application: lightweight metrics and the Compile Report. Lightweight metrics is a mechanism that allows you to gather performance statistics at runtime. Without adding any instrumentation to your code, you’ll be able to review measurements for the startup speed of your application and the time it takes to make GWT-RPC calls to the server. In addition, you can instrument your application to measure performance as you see fit, allowing you to better understand how your application performs and where you can optimize it.

19.1. Using the lightweight metrics tool

19.2. Using the Compile Report

19.3. Making use of code splitting

19.4. Summary