Revision: 5764
Author: [email protected]
Date: Tue Jul 21 13:52:01 2009
Log: Documented the initial load sequence.
http://code.google.com/p/google-web-toolkit/source/detail?r=5764
Modified:
/wiki/CodeSplitting.wiki
=======================================
--- /wiki/CodeSplitting.wiki Tue Jul 21 13:42:16 2009
+++ /wiki/CodeSplitting.wiki Tue Jul 21 13:52:01 2009
@@ -248,6 +248,52 @@
and then break a link in the dependency chain that comes up.
+=Specifying an initial load sequence=
+By default, every split point is given an exclusive fragment rather
+than an initial fragment. This gives your application maximum
+flexibility in the order the split points are reached. However,
+it means that the first split point reached must pay a significant
+delay, because it must wait for the leftovers fragment to load
+before its own code can load.
+
+If you know which split point in your app will come first, you
+can improve the app's performance by specifying an initial load
+sequence. Simply add a line such as the following to your
+module's gwt.xml file:
+{{{
+ <extend-configuration-property
name="compiler.splitpoint.initial.sequence"
+ value="@com.yourcompany.yourprogram.SomeClass::someMethod()" />
+}}}
+The `value` part of the line specifies a split point. Currently the only
way
+to specify a split point is to include a complete JSNI reference to the
method
+enclosing the split point in question.
+
+For some applications, you will know not only the first split point
reached,
+but also the second and maybe even the third. You can continue extending
+the initial load sequence by adding more lines to the configuration
property.
+For example, here is module code to specify an initial load sequence of
+three split points.
+{{{
+ <extend-configuration-property
name="compiler.splitpoint.initial.sequence"
+ value="@com.yourcompany.yourprogram.SomeClass::someMethod()" />
+ <extend-configuration-property
name="compiler.splitpoint.initial.sequence"
+ value="@com.yourcompany.yourprogram.AnotherClass::someMethod()" />
+ <extend-configuration-property
name="compiler.splitpoint.initial.sequence"
+ value="@com.yourcompany.yourprogram.YetAnotherClass::someMethod()" />
+}}}
+
+The down side to specifying an initial load sequence is that if the split
+points are reached in a different order than specified, then there will
+be an even bigger delay than before before that code is run. For example,
+if the third split point in the initial sequence is actually reached first,
+then the code for that split point will not load until the code for the
first
+two split points finishes loading. Worse, if some non-initial split point
+is actually reached first, then all of the code for the entire initial load
+sequence, in addition to the leftovers fragment, must load before the
requested
+split point's code can load. Thus, think very carefully before putting
anything
+in the initial load sequence if the split points might be reached in a
different
+order at run time.
+
=Common coding patterns=
GWT's code splitting is new, so the best idioms and patterns for using
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---