Sunday, August 30, 2015

Why code ends up in Left over Soyc report? How to analyze?

Please some help on the following issue (GWT version 2.7.0). 
I have a problem with left over code that is included in the initial download, that shouldn't be there.

The situation:
I have 2 GWT apps:  Ztoeslag and Declare, independent of eachoterh, in their own Eclipse project.
I created an additional GWT app Total in his own Eclipse project that contains very little code: it has dependencies to the Ztoeslag and Declare project. It shows 1 single screen with 2 buttons that will start the Ztoeslag and Declare app. These buttons start the app through a split point, by using GWT.RunAsync. The start occurs in the UtilsTotal:

        public static void ensureDeclareStarted(final AppStartContext startContext) {

           GWT.runAsync(new RunAsyncCallback() {

                public void onSuccess() {

                        DeclareStarter.getInstance().start(startContext);

                }


                                   public void onFailure(final Throwable ex) {

                    throw GenExpClass.createExceptionVarMsg(ex);

                }

            });

       }


                public static void ensureZtoeslagStarted(final AppStartContext startContext) {

            GWT.runAsync(new RunAsyncCallback() {

               public void onSuccess() {

                      ZtoeslagStarter.getInstance().start(startContext);

               }


                                public void onFailure(final Throwable ex) {

                   throw GenExpClass.createExceptionVarMsg(ex);

               }


             });

       }


The classes DeclareStarter and ZtoeslagStarter are only referenced in the code above (verified by Eclipse showing their references).
The GWT app is build through Maven with a code fragment set to 8.
The soyc report of Total has an total size of something like 1.7M, start size: 400KB, and left over of 700KB. This is huge for Total that has hardly any code.
Looking at the soyc I noticed that the left over contains code that is only used by the Declare app. If it would be used in both app, I could understand that it's contained in the left over (but still would expect it to be included in an exclusive fragment).
So why?

Analyzing:
I find it hard to read the soyc report, but looking at a class that is only used in Declare, like for example class "InkomstenOverzichtCalculator2011", the soyc report looks like below (stripped out the beginning of the package names):
com.common.declaration.overzicht.inkomsten.calculate.y2011.InkomstenOverzichtCalculator2011
See why it's live
See why it'
s not exclusive to s.p. #1 (@com.gwt.plus.declare.lazyloader.impl.DeclareLazyLoaderDefault::createInCodeSplitDeclare100,@com.bv.gwt.plus.declare.lazyloader.impl.DeclareLazyLoaderDefault::createInCodeSplitDeclare100)
See why it's not exclusive to s.p. #2 (@com.gwt.plus.ztoeslag.lazyloader.impl.ZtoeslagLazyLoaderDefault::createInCodeSplitGeneral10,@com.bv.gwt.plus.declare.lazyloader.impl.DeclareLazyLoaderDefault::createInCodeSplitGeneral10)
See why it'
s not exclusive to s.p. #3 (@com.gwt.plus.ztoeslag.lazyloader.impl.ZtoeslagLazyLoaderDefault::createInCodeSplitZtoeslag20,@com.bv.gwt.plus.declare.lazyloader.impl.DeclareLazyLoaderDefault::createInCodeSplitDeclare10)
See why it's not exclusive to s.p. #4 (@com.gwt.plus.total.misc.UtilsTotal::ensureDeclareStarted,@com.bv.gwt.plus.total.misc.UtilsTotal::ensureZtoeslagStarted)
See why it'
s not exclusive to s.p. #5 (@com.gwt.plus.lazyloader.impl.GeneralAppLazyLoader::createInCodeSplitGeneral10)
See why it's not exclusive to s.p. #6 (@com.gwt.plus.lazyloader.impl.GeneralAppLazyLoader::createInCodeSplitGeneral20)
See why it'
s not exclusive to s.p. #7 (@com.gwt.plus.lazyloader.impl.GeneralAppLazyLoader::createInCodeSplitGeneral30)
See why it's not exclusive to s.p. #8 (@com.gwt.plus.lazyloader.impl.GeneralAppLazyLoader::createInCodeSplitGeneral40)
See why it'
s not exclusive to s.p. #9 (@com.gwt.plus.ztoeslag.lazyloader.impl.ZtoeslagLazyLoaderDefault::createInCodeSplitZtoeslag10)
See why it's not exclusive to s.p. #10 (@com.gwt.plus.total.lazyloader.impl.TotalAppLazyLoader::createInCodeSplitGeneral10)


The class "InkomstenOverzichtCalculator2011" is contained in a common project that is both included in Ztoeslag and Declare, but ONLY used in Declare...
Splitpoint #4 is the one in UtilsTotal from the code above. But I only see a single split point ?? While UtilsTotal contains 2 runAsyn calls. Its like they are merged in 1 split point? Maybe because the split points are contained in the same Class. But they other split points from the other app's, are also contained in the same class and all show up correctly, that: the listed split points correspond to the runAsyn calls.

If I then dive deeper, and click on split point #4 (UtilsTotal) to see why it's a live, I don't really understand why it's alive, as what appears is this:
Class: com.common.declaration.overzicht.inkomsten.calculate.y2011.InkomstenOverzichtCalculator2011 Size (bytes)
com
.common.declaration.overzicht.inkomsten.calculate.y2011.InkomstenOverzichtCalculator2011::InkomstenOverzichtCalculator2011 31
com
.common.declaration.overzicht.inkomsten.calculate.y2011.InkomstenOverzichtCalculator2011::reisAftrek

And above both 2 entries  expanded (it shows the dependency path from bottom to top):
com.common.declaration.overzicht.inkomsten.calculate.y2011.InkomstenOverzichtCalculator2011::InkomstenOverzichtCalculator2011
com
.common.declaration.overzicht.calculate.y2011.OverzichtCalculationModel2011::OverzichtCalculationModel2011
com
.gwt.plus.declare.overzicht.calculation.OverzichtCalculationFacade::$createOverviewModel
com
.gwt.plus.declare.overzicht.calculation.DeclareOverviewCalculator::$calculateMoneyBack
com
.gwt.plus.declare.overzicht.impl.OverzichtControllerBase::calculateMoneyRequest
com
.gwt.plus.declare.overzicht.flow.ResultContext::$isRefundEnoughToReceive
com
.gwt.plus.declare.overzicht.flow.ResultContent::$isValid
com
.gwt.plus.declare.overzicht.flow.SimpleOverzicht::$isValid
com
.gwt.plus.declare.overzicht.impl.OverzichtViewDefault::isValid
com
.gwt.plus.displaymodel.InvalidDisplayVisitor::$visit
com
.gwt.plus.displaymodel.InvalidDisplayVisitor::visit
com
.gwt.plus.declare.misc.InvalidDisplayNavigationCommand::execute
com
.gwt.plus.declare.start.DeclareApplicationStarter::$initializeKeyNavigator
com
.gwt.plus.declare.start.DeclareApplicationStarter::beforeStarting
com
.gwt.plus.declare.connect.DeclareGeneralApplicationContextFactory::createApplicationStarter
com
.gwt.plus.declare.DeclareRegister::$ensureGeneralApplicationContextAdded
com
.gwt.plus.declare.history.DeclareHistoryTrackerCommandBase::beforeRun
com
.gwt.plus.history.RichHistoryTrackerBuilderBase::run
com
.gwt.plus.declare.overzicht.impl.OverzichtResultHistory$InstanceHolder::$clinit
com
.gwt.plus.declare.overzicht.impl.OverzichtViewDefault::$showResult
com
.gwt.plus.declare.overzicht.impl.OverzichtViewDefault::show
com
.gwt.plus.declare.overzicht.impl.OverzichtFacade::$createOverzichtView
com
.gwt.plus.declare.overzicht.impl.OverzichtControllerBase::$getEnsurePresenter
com
.gwt.plus.declare.overzicht.impl.OverzichtControllerBase::show
com
.gwt.plus.declare.lazyloader.impl.DeclareLazyLoaderDefault::$createCodeSplitDeclare100

com.common.declaration.overzicht.inkomsten.calculate.y2011.InkomstenOverzichtCalculator2011::reisAftrek
com
.common.declaration.overzicht.calculate.y2011.OverzichtCalculationModel2011::OverzichtCalculationModel2011
com
.gwt.plus.declare.overzicht.calculation.OverzichtCalculationFacade::$createOverviewModel
com
.gwt.plus.declare.overzicht.calculation.DeclareOverviewCalculator::$calculateMoneyBack
com
.gwt.plus.declare.overzicht.impl.OverzichtControllerBase::calculateMoneyRequest
com
.gwt.plus.declare.overzicht.flow.ResultContext::$isRefundEnoughToReceive
com
.gwt.plus.declare.overzicht.flow.ResultContent::$isValid
com
.gwt.plus.declare.overzicht.flow.SimpleOverzicht::$isValid
com
.gwt.plus.declare.overzicht.impl.OverzichtViewDefault::isValid
com
.gwt.plus.displaymodel.InvalidDisplayVisitor::$visit
com
.gwt.plus.displaymodel.InvalidDisplayVisitor::visit
com
.gwt.plus.declare.misc.InvalidDisplayNavigationCommand::execute
com
.gwt.plus.declare.start.DeclareApplicationStarter::$initializeKeyNavigator
com
.gwt.plus.declare.start.DeclareApplicationStarter::beforeStarting
com
.gwt.plus.declare.connect.DeclareGeneralApplicationContextFactory::createApplicationStarter
com
.gwt.plus.declare.DeclareRegister::$ensureGeneralApplicationContextAdded
com
.gwt.plus.declare.history.DeclareHistoryTrackerCommandBase::beforeRun
com
.gwt.plus.history.RichHistoryTrackerBuilderBase::run
com
.gwt.plus.declare.overzicht.impl.OverzichtResultHistory$InstanceHolder::$clinit
com
.gwt.plus.declare.overzicht.impl.OverzichtViewDefault::$showResult
com
.gwt.plus.declare.overzicht.impl.OverzichtViewDefault::show
com
.gwt.plus.declare.overzicht.impl.OverzichtFacade::$createOverzichtView
com
.gwt.plus.declare.overzicht.impl.OverzichtControllerBase::$getEnsurePresenter
com
.gwt.plus.declare.overzicht.impl.OverzichtControllerBase::show
com
.gwt.plus.declare.lazyloader.impl.DeclareLazyLoaderDefault::$createCodeSplitDeclare100

But this is weird as the path's start at the bottom with Split point Declare100, while I clicked on the split point #4 UtilsTotal.... Even searching on the soyc web page, these are the only entries related to the class "InkomstenOverzichtCalculator2011". Why is this? What is wrong or I don't understand?

Anyway: looking at these paths, it's completely used/included by the Declare app, and not the Ztoeslag app, so why is it contained in the left over fragment?
Should I maybe adjust the fragmentCount that is specified during the build (currently set to 8)..?

Please advice/help on this to track the cause?
- Ed

--
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-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment