Code splittingmysteries

203 views
Skip to first unread message

Ed

unread,
Mar 20, 2013, 7:53:11 AM3/20/13
to google-we...@googlegroups.com
After upgrading from 2.5.0 to 2.5.1 all of a sudden my code splitting result is different:
+ Code fragments are bundles together which weren't before.
+ I have a left over fragment, which was 0 (see attachment).

What changed concerning code splitting? Can't find any in the release notes.

A few observations:
1) All my components have a singleton facade that contains a method to create the package protected  controller implementation that is called through split point (GWT.runAsync()).
In this way I have a LoginControllerDefault that is present in the left over, but this package protected controller ONLY appears in the LoginFacade.
In the same way I have SubscribeControllerControllerDefault that appears only in SubscribeControllerFacade...
What suprised me is that they appear both in the same code split, namely #30 (see screenshot attachment).

No idea why.
I moved the creation of  LoginControllerDefault  from the Facade "directly" (see below for code snippets) in to the runAsync, but that had no effect.
I also removed the LoginControllerDefault completely which had little effect on the left-over

When I read the soyc report (automatically build during maven nightly build), It doesn't really help me. This page is hard to understand, like this page:
               soycReport/compile-report/leftoverStatus-0.html

Even worse,  from this page you can go deeper  to see why a class is in a certain split point but that results in a page not found (404).
That is, the following page isn't present. BTW: the page also resulted in a 404 in previous GWT releases.
                 soycReport/compile-report/methodDependencies-total-0.html
Why?

I played with the nr of "fragmentCount", but that has little effect, see the attached screenshots:
+ fragmentCount = 6: screenshot with 4 splits points.
+ fragmentCount = 8: screenshot with 6 splits points.
+ fragmentCount = 10: screenshot with 7 splits points.

Below a code snippet that shows how I create the controllers in split point #30 (see screenshot). It concerns the creation of the LoginControllerDefault and SubscribeInfoControllerDefault.
Note: I don't find it the most elegant code solution, but before I passed in a Creator interface that was used in GWT.runAsync(), but that didn't work (big left over). I posted that in the forum and it was mentioned that it could be that it is because the code removal is run after the split point code, and that is probably why it doesn't work and that Ray still have a look in to code split code that need to be optimized.

How to solve/analyze these issues?
What are your experiences?
Any suggestions are more then welcome as I am out of ideas and find it hard to solve this, but it frustrates me ;)


Loading and creating the the Login and SubscribeInfo controller:
-----
The code snippet that is called by the LoginControllerBuilder to load the Login controller:
public void create(final AsyncCallback<LoginController> callback) {
getLazyLoader().createInCodeSplitGeneral30(LoginController.class, callback);
}


The controller loading code (in other class):
public <T> void createInCodeSplitGeneral30(final Class<T> type, final AsyncCallback<T> callback, final SimpleMediator mediator) {
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
callback.onSuccess(createCodeSplitGeneral30(type, mediator));
}

public void onFailure(final Throwable reason) {
callback.onFailure(reason);
}
});
}

@SuppressWarnings("unchecked")
private <T> T createCodeSplitGeneral30(final Class<T> type, final SimpleMediator mediator) {
if (isType(type, LoginController.class)) {
return (T) LoginFacade.getInstance().createController();
}
else if (isType(type, SubscribeController.class)) {
return (T) SubscribeFacade.getInstance().createController();
}
else {
throw GenExpClass.createExceptionVarMsg(getClass(), ERR_ID + "Gn30", type);
}
}


fragmentCount6.png
fragmentCount8.png
fragmentCount10.png

Ashton Thomas

unread,
Mar 20, 2013, 10:22:48 AM3/20/13
to google-we...@googlegroups.com
I would also be interested in any updates to this as I am currently working on the async aspect or my app. (I wouldn't even know how to identify anomalies due to a lack of experience here)

I also remembrer having the same questions with soyc

-at 

Ed Bras

unread,
Mar 25, 2013, 11:03:38 AM3/25/13
to google-we...@googlegroups.com
BTW: a corresponding issue in the issue tracker: https://code.google.com/p/google-web-toolkit/issues/detail?id=7874
Let's hope more people are experiencing the same problem (and vote the issue) such that the dev team put it on their priority list.


--
You received this message because you are subscribed to a topic in the Google Groups "Google Web Toolkit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/_8CdVbBb488/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ed Bras

unread,
Apr 10, 2013, 3:13:07 AM4/10/13
to google-we...@googlegroups.com
I just downgraded to GWT 2.4 and my left over fragment disappeared :(... (initial load was almost the same)
Strange.... -> or 2.4. had a code splitting involved bug or 2.5. has one...

James Horsley

unread,
Jun 12, 2013, 5:59:17 AM6/12/13
to google-we...@googlegroups.com
Ed, did you ever get this sorted? As I commented on the linked issue I'm running into what seems to be a similar problem.
To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsub...@googlegroups.com.
Message has been deleted

Ed

unread,
Jun 12, 2013, 8:13:06 AM6/12/13
to google-we...@googlegroups.com
Ed, did you ever get this sorted? As I commented on the linked issue I'm running into what seems to be a similar problem.
No. It's hard to track the exact cause. It tried, but had to give up (a lot of time, and not knowing exactly what happens.
But it's good to see that more people are experiencing the same kind of problems such that I am not alone ;)
Ray seem to be the code splitting guru. Let's hope he has has some time to look at this ;)

If you can isolate the problem in a small program that reproduces this behavior, please do upload it in the issue. I tried, but failed :(
This will help the gwt dev team a lot to solve the problem (and the issue will get a higher priority and solved sooner).

James Horsley

unread,
Jun 12, 2013, 10:45:37 AM6/12/13
to google-we...@googlegroups.com
Yeah. I've tried reproducing the issue with a sample app but thus far haven't been able to; not sure that the sample webapp captures enough of the complexity of the actual webapp we're having the problem with. As I mentioned before can confirm that changing none of the webapp code but switching between 2.5 and 2.5.1 causes everything to end up in the leftover. From the compiler report it's not at all obvious why these classes are in the leftover fragment as they look isolated from what I can tell.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.

James Horsley

unread,
Jun 12, 2013, 11:14:16 AM6/12/13
to google-we...@googlegroups.com
Quite frustrating as I don't feel like I'm making much progress and am just going to have to go back to 2.5.0 but don't really want to lose out on the bugfixes from 2.5.1 :(

Ed Bras

unread,
Jun 12, 2013, 11:18:23 AM6/12/13
to google-we...@googlegroups.com
Yep, tried to go back to 2.5, but then I see some other bugs that are solved in 2.5.1 ;)... So for me this was no option...


On Wed, Jun 12, 2013 at 5:17 PM, Ed Bras <post2...@gmail.com> wrote:
Yes, I understand what you mean, I experienced the same... 
It's hard to hand over a "test case" that fails, to the dev team, such that they can use that to work on :(

Yes it would be nice to have better  facilities such that we can try to track done the cause our self. Currently the SOYC report isn't helping a lot. 
To my experience the SOYC report is buggy, as some pages result in a 404 :(.. (I experienced that several times the last years with a correctly created soyc, it's also in some issue if I remember correctly).



--
You received this message because you are subscribed to a topic in the Google Groups "Google Web Toolkit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/_8CdVbBb488/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.

Ed Bras

unread,
Jun 12, 2013, 11:17:28 AM6/12/13
to google-we...@googlegroups.com
Yes, I understand what you mean, I experienced the same... 
It's hard to hand over a "test case" that fails, to the dev team, such that they can use that to work on :(

Yes it would be nice to have better  facilities such that we can try to track done the cause our self. Currently the SOYC report isn't helping a lot. 
To my experience the SOYC report is buggy, as some pages result in a 404 :(.. (I experienced that several times the last years with a correctly created soyc, it's also in some issue if I remember correctly).

On Wed, Jun 12, 2013 at 4:45 PM, James Horsley <james....@gmail.com> wrote:

--
You received this message because you are subscribed to a topic in the Google Groups "Google Web Toolkit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/_8CdVbBb488/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.

James Horsley

unread,
Jun 12, 2013, 11:29:39 AM6/12/13
to google-we...@googlegroups.com
Yeah. the SOYC report in this case hasn't helped me much either because I'm not reading it right or it's just not surfacing the right info. The only 404 I get is regarding the "compiler metrics" link.

James Horsley

unread,
Jun 12, 2013, 11:31:42 AM6/12/13
to google-we...@googlegroups.com
Ed, out of interest, are you using Gin?

Ed Bras

unread,
Jun 12, 2013, 2:29:41 PM6/12/13
to google-we...@googlegroups.com
No, it's not you, understanding the details of the SOYC report is hard.
I thought it was easy from seeing the Google IO session some years ago, butt... ...
It's definitely a step in the right direction but the soyc report still need some optimization steps to be well usable for "bigger" projects (then Hello world)

Ed

unread,
Jun 12, 2013, 2:34:40 PM6/12/13
to google-we...@googlegroups.com
Ed, out of interest, are you using Gin?
No, but probably would use it if I would start "blank". 
When I started with GWT (about 7 years ago), there was no GIN, so I had to make my own "thinks" like factories, which I use nowadays .  This all resulted in having build my own rich gwt framework/lib, which I am happy about thought, works well..
But in general I am careful using external gwt lib's there are many out there being not maintained anymore, which can result in gwt upgrade problems..
I started out with mygwt, contributed some things... but then It became gxt and became half commercial :(

James Horsley

unread,
Jun 13, 2013, 7:02:46 AM6/13/13
to google-we...@googlegroups.com
FYI I updated http://code.google.com/p/google-web-toolkit/issues/detail?id=7874 with some of my findings. I haven't found a workaround other than reverting to GWT 2.5.0 and am not sure I can dedicate any more time to this right now so will just revert I guess :(


--
Reply all
Reply to author
Forward
0 new messages