Ok. My fault:

By returning a single string containing all the child-node
information, I produced a string that was too long.
Returning an array of strings instead worked flawlessly.
(I still wonder why my first approach worked in hosted mode, but
ok...).

Thanks.
Philipp

On 11 Jan., 13:36, "[email protected]"
<[email protected]> wrote:
> Hi,
>
> I am using the Fast GWT Tree from the GWT incubator project in version
> from Mon, 22 Jun 2009 (for GWT 1.7). I am using GWT 1.7.1 and I have
> the following problem:
>
> FastTree performs great in hosted mode, but once I compile my code,
> suddenly, the performance is extremely slow.
>
> Please find attached the relevant code. As you can see, I display two
> alert messages. The first being displayed when the server call
> returned the loaded the children of a tree node, the second being
> displayed as soon as the tree is rendered.
> In hosted mode, displaying takes 6.5 seconds for 4000 children (which
> is perfect!), in the browser (either FF 3.5 or IE 7 (same as hosted
> mode) or IE8), it takes "ages" (it's still working, while I have been
> typing this e-mail; at least 5 minutes).
>
> Do you have any idea, why this could occur? Server times are
> identical, only the rendering is much slower in web mode...
>
> The structure of my test tree is so that it has a root node, which has
> 4000 children. None of the children have other children. So, the first
> call to load children actually only reads the root element ("All
> Elements") and by opening it, 4000 children are loaded. The latter
> call never finished in web mode (still not done).
>
> Thanks for any insights.
> Kind regards, and thanks very much for this component!
> Philipp Bouillon
>
>     private SimpleTreeNode root;
>
>     private Widget createLazyTree() {
>         FastTree.addDefaultCSS();
>
>         FastTree t = new FastTree();
>         root = new SimpleTreeNode(null, hierarchy.getType(),
> hierarchy.getId(), hierarchy.getName(), 1, hierarchy);
>         loadChildren(t, root);
>         return t;
>     }
>
>     private void loadChildren(final HasFastTreeItems parent, final
> SimpleTreeNode node) {
>         System.out.println("Starting load children on " +
> node.getDataObjectName());
>         final long t1 = System.currentTimeMillis();
>         WPaloServiceProvider.getInstance().loadChildren(node, new
> AsyncCallback<String>() {
>             public void onSuccess(String nodes) {
>                 System.out.println("NodeString: " + nodes);
>                 final long t2 = System.currentTimeMillis();
>                 // Depending on the "mood" of the server, takes
> between 3 and 7 seconds in both, web and hosted mode
>                 com.google.gwt.user.client.Window.alert("Loading
> children finished after: " + (t2 - t1));
>                 String [] sNodes = nodes.split("\\|");
>                 for (int i = 0, n = sNodes.length; i < n; i += 4) {
>                     final String dataType = sNodes[i];
>                     final String dataId   = sNodes[i + 1];
>                     final String dataName = sNodes[i + 2];
>                     final int    dataCC   = Integer.parseInt(sNodes[i
> + 3]);
>
>                     FastTreeItem item = new FastTreeItem(dataName) {
>                         public void ensureChildren() {
>                             loadChildren(this, new SimpleTreeNode
> (node, dataType, dataId, dataName, dataCC,
>                                     new XElementNode(new XElement
> (dataId, dataName, dataCC > 0 ? XElementType.CONSOLIDATED :
> XElementType.NUMERIC))));
>                         }
>                     };
>                     if (dataCC > 0) {
>                         item.becomeInteriorNode();
>                     }
>                     parent.addItem(item);
>                 }
>                 final long t3 = System.currentTimeMillis();
>                 // Fast in hosted mode (~ 6 seconds, _slow_ in Web
> Mode: never finished):
>                 com.google.gwt.user.client.Window.alert("Displaying
> children took: " + (t3 - t2));
>             }
>
>             public void onFailure(Throwable arg0) {
>             }
>         });
>     }
-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


Reply via email to