How far does the optimizations of the GWT compiler go..?
226 views
Skip to first unread message
Carsten
unread,
Jun 21, 2012, 4:17:53 PM6/21/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
Hi,
I was wondering how well the GWT compiler is able to remove unused parts? Can it even remove methods and fields from a class which are never used?
Example:
VeryComplexObject vco = null;
initVCO() { ... };
If initVCO is never called from my code, will the GWT compiler remove the method initVCO(), the field vco, or even the VeryComplexObject class itself?
Can I somehow check what the GWT compiler removed and what not? Is there a log which lists removed parts?
Thanks, Carsten
Dennis Haupt
unread,
Jun 21, 2012, 4:29:43 PM6/21/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
i would not rely on that. there are tools which are better suited for
this. my first choice would be intellij idea because it can also detect
calls to methods from those native js gwt thingies that other tools
don't understand. they would detect methods called only from native js
as unused.
and yes you can check: compile in pretty mode. the code won't be
obfuscated and you can search for the class name and specific methods.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
Yes it will remove methods and classes that are not used. If you compile with the option -compileReport it will generate a soyc report that shows you all the code that is included in your project.
Carsten
unread,
Jun 21, 2012, 4:59:09 PM6/21/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
Interesting. What means soyc?
Message has been deleted
Paul Stockley
unread,
Jun 21, 2012, 5:15:43 PM6/21/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
Story of your compile. Do a google search.
Carsten
unread,
Jun 23, 2012, 8:32:23 AM6/23/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
Thanks. I tried it.
Strangely only soycReport/compile-report/CompilerMetrics-0-index.html is generated. For all the other browsers their files are missing. When I open soycReport/compile-report/index.html and click on one of the 'Compiler Metrics' links only the first (Safari) is functional. The rest of the links is not working since the following files are missing:
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
I tried enabling SOYC yesterday too (GWT 2.3). I had the same issue. The links on the index page for the first permutation worked, but not the second permutation. SOYC defect?
Joseph
Jim Douglas
unread,
Jun 23, 2012, 11:35:50 AM6/23/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
Thanks Jim.
I starred it and commented on it. Anyone else affected should do the same.
Sincerely,
Joseph
Carsten
unread,
Jun 23, 2012, 3:55:26 PM6/23/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
I did.
When I compile with -compileReport, at least the first link for Safari works. All other links do not. If I compile with -XsoycDetailed not even the first link is working. It creates all other files from the report though.
Joseph Lust
unread,
Jun 24, 2012, 10:20:28 AM6/24/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
Carsten,
Did you try compiling the SoycDashboard tool as detailed in the docs? I have not, but it sounds like it might be an alternative viewer for all the XML files that are created, but not shown on the index html page.
Sincerely,
Joseph
Carsten
unread,
Jun 24, 2012, 2:12:50 PM6/24/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
I haven't yet -- maybe I will. Strange that this problem is not fixed yet.
mdwarne
unread,
Jun 24, 2012, 2:37:52 PM6/24/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
I once wrote a library of classes, and wrote a test program that exercised a few of them.
Then I looked at the javascript generated in 'pretty' mode. It was very tiny, only the few methods I used where included, and many of the local variables etc where removed through optimizations etc. For the large classes, they where reduced in size, to almost nothing... since I didn't use the functionality, it was totally stripped out. I was also surprised to see my calculations that called various methods where often completely replaced with a constant, since my test program specified the inputs to the methods, the compiler was able to calculate the result, and reduce it to a single value...
It is very good at optimizing out what you don't use..