You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Filip Pavlin <fp...@pinnacle.com.au> on 2007/11/20 01:41:46 UTC

Tree widget - slow when heavily populated? (2)

Hi again,

 

This is just a follow-up to my previous message (see below).

 

I looked a bit more into this and I think I might have found the reason for
the slowdown. If I understand it right AJAX is used to limit the data that
is being sent between server and browser, sending only the data that
actually has changed. This is happening on a per-widget basis, i.e. only the
data of the widgets that have changed get sent.

Now here (I think) is the problem. If I expand a node in the tree widget the
whole tree widget is marked to indicate the change. So, if the tree already
has lots of expanded nodes (hundreds) and I expand another node, the whole
tree data is being sent (and not only the data of the node that has been
clicked), which obviously will take more and more time the bigger the tree
grows. Running the cocoon profiler also seemed to confirm this.

 

My question now is, can anyone confirm my findings and if so, does anyone
know how I could fix this problem, i.e. is there a way that only the node
data gets sent instead of the whole tree data?

 

 

Thanks again for your time.

 

   _____  

From: Filip Pavlin
Sent: Friday, 16 November 2007 12:10 PM
To: 'users@cocoon.apache.org'
Subject: Tree widget - slow when heavily populated?

 

Hi,

 

I just recently added the cocoon tree widget to our application (which I’m
populating dynamically with data from a database) and everything is working
fine (I’m using cocoon-2.1.9, jdk1.6, tomcat-5.5.17 on Win XP).

However, I noticed that the opening of a node takes significantly longer
(even if there’s only one child-node underneath) if there are lots of nodes
already displayed (with ‘lots of node’ I mean many hundreds or even more).
The opening of the same node takes much less time if I minimize the number
of open nodes.

 

To illustrate this:

 

|

|---|

|   |---

|   … (hundreds of open nodes)

|   |---

|

|---|      <-- opening node with only one child takes about 10s

|

 

 

|

\

|

|---|      <-- opening same node as above (with only one child) takes about
1s

|

 

 

 

Has anyone observed this kind of behaviour? Is that an expected behaviour?

Apart from the tree population (which as I mentioned is happening
dynamically) everything else is implemented pretty much in the same way as
the tree samples provided with cocoon-2.1.9.

 

 

Thanks for your time.

 

Filip

 


Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.19 - Release Date: 2/11/2007 12:00
AM



No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.1/1140 - Release Date: 19/11/2007
7:05 PM
 

Re: Tree widget - slow when heavily populated? (2)

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Filip Pavlin pisze:
> Hi again,

Hi Filip.

> This is just a follow-up to my previous message (see below).
> 
>  
> 
> I looked a bit more into this and I think I might have found the reason
> for the slowdown. If I understand it right AJAX is used to limit the
> data that is being sent between server and browser, sending only the
> data that actually has changed. This is happening on a per-widget basis,
> i.e. only the data of the widgets that have changed get sent.
> 
> Now here (I think) is the problem. If I expand a node in the tree widget
> the whole tree widget is marked to indicate the change. So, if the tree
> already has lots of expanded nodes (hundreds) and I expand another node,
> the whole tree data is being sent (and not only the data of the node
> that has been clicked), which obviously will take more and more time the
> bigger the tree grows. Running the cocoon profiler also seemed to
> confirm this.
> 
>  
> 
> My question now is, can anyone confirm my findings and if so, does
> anyone know how I could fix this problem, i.e. is there a way that only
> the node data gets sent instead of the whole tree data?

I can confirm your findings.

When it comes to fixing this problem I would say that I'm sure it's possible to fix but I'm not sure
how hard it's going to be. Basically you need to implement partial updates of tree widget. In order
to do this, you will have to look at jx-macros.xml and compare how partial updates are implemented
for Tree widget and Repeater widget. The latter has more fine-grained control over how it's updated
in Ajax mode.

If you want further advice on how to fix this problem don't hesitate to ask. Patched version of tree
widget with fixed this problem would be greatly welcomed.

-- 
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org