Poor GWT performance

as an introduction: I'm new to GWT and coding, so my questions may seem basic.

I have made a web application using GWT, Maven, Hibernate, IntelliJ IDEA. I have deployed the application to my own Tomcat server (I have a separate computer for this: HP ProLiant ML310e Gen8 v2 4-Core 3.1GHz 4GB DDR3 + HDD 2x1TB SATA).

It is a simple page with 5 tabs and it has one 48Kb .png as its title. The initially loaded view has:

  • 2 Labels with multiple words,
  • CellTable contains 20 rows (content is obtained from the database via RPC, from the database)
  • 4 buttons (for swapping tables)

This view has almost no content, it has the following panels just for the exact layout I want:

3 vertical panels, 6 horizontal panels, 1 wood and 1 mesh

Problem: . When I run the url for the first time, it doesn't take anything 1:09 min to download. And every time I paste the url, it takes about a second to display the app. (after loading the page everything goes smoothly, just a second to display the widget)

I read this article: http://blog.trifork.com/2007/11/30/optimizing-startup-time-for-gwt-hosted-mode/ , but the server starts the app in production mode (GWT.getScript () returns true). I've also looked at a few topics on stackoverflow, but I don't see what load time is "normal" for small size applications.

If something takes longer than 30 seconds to run, then GWT seems unacceptable to the average user who might think the link is broken the first time ... I don't know how it works - this is rebuilding and recompiling the GWT page for every new request user?

+3


source to share


3 answers


I don't know how it works - is it rebuilding GWT and recompiling the page for every new user request?

Not.

GWT uses caching. The initial load time really depends on many factors.



When the user / browser requests for the first time, all resources related to page loading are loaded. It takes a few seconds to download and really depends on your internet speed.

After the page has fully loaded, and if you request a new page / reload the current page, this time all resources will not load.

Comes to the conclusion that rebuilding and recompiling for every request is wrong. There are permutations in Gwt that are specific to each browser. Each major browser has its own permutation. If you ask Mozilla for example permutations related to Mozilla downloads. These permutations are actually generated during compilation of the project, which you did in your IDE before deploying the project.

Once the request hits the browser, for the first time, all files associated with a particular permutation are downloaded to the browser and cached in the browser. Next time in word form, you won't see any new files being downloaded to the browser (you can see that with your firebug).

Using code splitting, lazy initialization routines and data compression.

Continue reading .....

+2


source


check the yourapp.gwt.xml file if you have inherited some modules that take time to load.

if so, it takes time on the first load and the way gwt works, it loads and maintains the cache for future loads, which answers your problem about loading the load the first time and a second to load next time.



And gwt doesn't rebuild or recompile the page, it just displays the page you compiled

+2


source


Take a look at GWT.runAsync, it will help you not to load everything on startup, just what you need :)

+1


source







All Articles