Max optimization level (-optmize 9) causes an infinite loop with GWT 2.8-RC2

189 views
Skip to first unread message

Ali Jalal

unread,
Aug 31, 2016, 4:00:41 AM8/31/16
to google-we...@googlegroups.com
​​
Hi,

I have some big projects (with about 500 views) which their web-mode compilation was working with GWT 2.7 and their compilation were completed in about 3 minutes.

After upgrading GWT to 2.8-RC2, their web-mode compilation were not completed after more than 60 minutes and it seems that created an infinite loop.

 I traced methods calls in compilation and I think there was a loop in calling JsInliner class.

After adding '-optimize 8' in compiler options (previously there was no -optmize parameter and so it was set to '-optmize 9'), all projects where compiled successfully.

Note that compiler with no -optimize parameter works well in some projects, but do not complete in some big projects.

I compared output JS size in optimization level 8 & 9 and optimization level 8 output JS size was smaller. So I applied '-optimize 8' to all projects.

My question is whats difference between optimization level 8 & 9  and what situations may produce an infinite loop?

Thanks.

Thomas Broyer

unread,
Aug 31, 2016, 4:58:35 AM8/31/16
to GWT Users
At level 9, the compiler (in JavaToJavaScriptCompiler) optimizes Java and JS until it cannot do any more changes (except it stops Java optimizations after 100 iterations; JS optimization iterations are not capped though). At level 8, the compiler only makes 8 optimization iterations, and will stop optimizing Java when the rate of changes is lower than 0.1 (if it reaches that threshold before the 8th iteration).
 
and what situations may produce an infinite loop?

There may be risks of infinite loops in each optimization step/pass, but as seen above, there's a risk of infinite loop in JS optimization at level 9, in case optimization steps change the JS AST at each pass.

In any case, that'd be a bug. Can you please file an issue on the issue tracker? https://github.com/gwtproject/gwt/issues
Reply all
Reply to author
Forward
0 new messages