2

I am interested in minimizing the time in between each iteration of my GWT software development. My environment is: Eclipse + Google's GWT Eclipse plugin + GWT 2.3 SDK.


Multicore:

Most of the time (about 90%) I waste in GWT development is spent waiting for the browser to refresh after I have made some code changes in development mode. (1.) If I migrate my development environment to a big server with 24 cores, does GWT's 'development mode' have any way to make use of the extra cores?

Memory:

The 'big server' also has 32 GB of memory, I know that you can allocate more memory for GWT's run configuration by modifying the '-Xmx512m' to specify more memory. (2.) Would allocating more memory via '-Xmx' command line switch speed up refresh times?

(3.) Another way to frame question 1 and 2 is to ask: What is the bottle neck for refresh times during 'development mode'?


(Less important (because I do not do full compiles often aka 90/10 rule): Does the "GWT compile" benefit from more cores? Does "GWT Compile" benefit from more memory?)

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Trevor Boyd Smith
  • 18,164
  • 32
  • 127
  • 177

4 Answers4

3

I waste in GWT development is spent waiting for the browser to refresh after I have made some code changes in development mode

Resources will help a little, but what will help a lot more optimising your code and making it leaner. Less bloat, less scripts, less junk.

It's not about the compiler, more about making sure your page loads fast.

More caching, more lazy loading, more minifying of resources.

Raynos
  • 166,823
  • 56
  • 351
  • 396
  • the main problem was the code executing in this case. I found out with this specific code that there was a single line of code that was causing the code-execution to take 5+ minutes instead of executing in 5 seconds. – Trevor Boyd Smith Sep 19 '11 at 18:20
  • FYI, Google Chrome behaves better when running heavy GWT code: firefox essentially freezes the entire firefox process... can't access other tabs or menu bar or anything. Chrome only freezes in the specific tab. – Trevor Boyd Smith Sep 19 '11 at 18:22
  • FYI, Google Chrome offers GWT specific debugging tools. Specifically it has a profiling tool for GWT. The GWT profiling tool is what showed me where the execution time was taking 5+ minutes... then I found the one the one line of code... and then I checked the profiler and saw that sure enough the code-change fixed the problem. – Trevor Boyd Smith Sep 19 '11 at 18:23
2

This is a frequent question on SO, see the old '09 thread here.

Here is what I've learned working with large enterprise GWT projects the last year:

  • GWT will use all cores unless you tell it not to via -localWorkers (N-1 is nice if you can spare it).
  • GWT loves I/O, I have projects that build in 5s on my 8GB/4 core/SSD box.
  • Running in Dev Mode (a.k.a. Hosted Mode) saves a ton of time. Just hit F5 in browser.
  • Enable the -draftCompile flag and don't optimize for dev builds.

But most importantly - Don't build what you don't need to build!

Make sure you are only using the needed permutations (user.agent). My company only supports FF, so that means build just 1 permutation, not 6. You could also collapse permutations if you need more than 1.

When we have a bunch of widgets or modules we're working on, we place them into GWT Library modules and build them separately using Maven. If you do this, then you can inheirt them and not spend your time building the entire project on every refresh, but rather just the salient items of your current module.

Community
  • 1
  • 1
Joseph Lust
  • 19,340
  • 7
  • 85
  • 83
1

I'm not sure if hosted mode benefits from more cores. GWT 2.4 promises to have significant performance boost for hosted mode and an SSD sure would help...

TheGuyWhoCodes
  • 360
  • 1
  • 3
  • 10
1

After I upgraded from dual pentium-D to quad core2 and with gigaglobs of memory, my compile time was reduced significantly. Like from 10 minutes to 3 minutes, anecdotally speaking.

I also moved to running Eclipse on linux and I do see a noticeable response improvement from eclipse. I am using ubuntu 64bit.

Instead of firefox or ie, I use google chrome and I superficially feel chrome is responding better.

Without any technical insider knowledge, I would say that the number of cores do help but only up to a certain number of cores. The reason I am guessing is that the more cores you have, the OS tasks would leave more cores idle for your development pleasure. With just two cores, eclipse jvm would be competing with the OS and the browser.

The browswer itself is tightly bound to the multitasking and multi-core parallelism of the OS. Therefore, having more cores would help in hosted mode debugging.

But after a certain number of increase in cores and memory and if you are the only user of the machine, you should no longer gain any benefit from further increase in number of cores and memory, because the excess cores and memory would no longer be utilised either by the jvm or the OS.

So anecdotally speaking again, 2 cores for your OS, as many cores as you have the number of hyperactive chrome tabs open, and one core for your jvm.

Let's say you

  • are watching battlestar gallactica on hulu on one tab = 2 cores (one for browser and one for flash)
  • are watching stock price of AAPL and GOOG on one tab = 2 cores (one for browser and one for flash)
  • plus 2 cores for OS tasks
  • plus 2 cores for your hosted mode tab
  • plus 1 core for your eclipse jvm.

Therefore, the worse case scenario would be to have 9 cores and beyond which, you should not have any benefit from the increase in the number of cores. For every task above anecdotally assign 1GB of physical memory. Therefore, for the above scenario, any increase in memory beyond 6 GB should not help.

QED - Anectodally speaking. Anecdotally, I meant.

Blessed Geek
  • 21,058
  • 23
  • 106
  • 176