Hi there,
Tony :
> Another way to improve performance is by:
> - whenever possible, group the things that need to be changed
> - when you want to update
> * detach that group from the DOM aka rendering tree
> * do your update (add new element, sub node, modify existing)
> * attach the group back
> * re render the DOMFor the refresh and rendering :
My logfile only give two line corresponding to refresh and that comes from
"UpdateManagerListener.updateCompleted".
I don't know why I have only 2 "refreshes" as my canvas is supposed to be
dynamic. That is why I think that the whole loop
is taken as a single modification but I must be wrong.
When you say "detach" do you think that removing the RenderingListener is
enought ?
My first idea was :
setDocumentState(ALWAYS_STATIC);
update
setDocumentState(ALWAYS_DYNAMIC);
But this is not doing anything.
Thomas :
I still try to get beter results with my updates and here are some more
informations :
>If the '78ms' is to update and render
a list of
>~100 text elements then it's probably what I expect
from
>Batik (unfortunately).
Unfortunatly, 78ms is the time to update a single label. The full update of the
list took about 5 seconds.
The "0 ms" one is normal : as I refresh the labels after deleting an element,
there is no text to update and so no time is spents there.
I tryed different implementations :
- When i use createElement instead of createElementNS, everything is so fast..
but not displayed.
- setTextContent is really not the solution with 12sec for 50 actions
- kill the node and recreate it give same performance as setNodeValue
Basically what i currently do is :
1. I put text nodes in a map to avoid useless getChildNodes. text node are
childrens of elementsNS
2. I delete an action. This triggers the update
3. I try to stop every slowing thing ( well it is not as simple as I tought)
4. I update each Node in my map with setNodeValue
5. I try put everything in initial state
I'll also try to explain what is the application supposed to do in a better way
^^
I have a list of Actions.
My SVG Canvas is a representation of pipes with equipments like pumps, captors
...
Action are applied on those equipment and they have to be done in a certain
order. The text added to the action represents this order.
So when I remove an action, all action have to be renamed :
For instance if I have action 1,2, and 3 : when I delete action 1 then 2
becomes 1 and 3 become 2.
2 -> 1 and 3->2.
That is what i need to represent on the SVG
Here you can have a snapshot a a very little part of my SVG canvas, and the
full svg
http://julien.beghin.free.fr/part_of_canvas.JPG
http://julien.beghin.free.fr/output.svg
I don't know if this will help but any advices or questions are welcome.
This problem is a good way for me to discover how Batik really works...
unfortunatly i really need performance here and I can't post the full
application.
Thanks,
Julien
To: [email protected]
CC: [email protected]; [EMAIL PROTECTED]
Subject: Re: Slow updates
From: [EMAIL PROTECTED]
Date: Wed, 17 Sep 2008 06:17:45 -0400
Hi Julien,
<[EMAIL PROTECTED]> wrote on 09/17/2008
04:44:42 AM:
> Still in the business part of my application, I may need to perform
> an update on a list of text elements in my canvas.
[...]
> This represent from 50 to 100 elements that can
need to be updated.
>
> Everything works fine but it tooks real long time to update the complete
list.
> I also added some "simple" timer[...]
Here are the results
> Updating action labels
> -> Updating action label 1 (0 ms)
> -> Updating action label 2 (94 ms)
> -> Updating action label 3 (78 ms)
If the '78ms' is to update and render
a list of
~100 text elements then it's probably what I expect
from
Batik (unfortunately).
[...]
> -> Updating action label 9 (438
ms)
[...]
> -> Updating action label 30 (625
ms)
> ...
> As you can see, there are very long update like
#30 with 625ms and
> the first one is at 0ms....
These almost certainly represent Java
Garbage collection
events. I suspect that the first one (0ms) is
a bug in the
timing code (or the change ends up being a no-op).
> I am new to Batik and i must have done something
wrong ( I hope that
> is the problem... ). I also hope, someone will
> figure out what is happening there.
Without the full app it's hard to say
for certain
but in general Batik's text layout is slow. The
reasons
for this are complex but boil down to some slowness
in
the underlying Java2D API's and the fact that Batik
doesn't
have a 'really simple' text layout path.
_________________________________________________________________
Email envoyé avec Windows Live Hotmail. Dites adieux aux spam et virus, passez
à Hotmail ! C'est gratuit !
http://www.windowslive.fr/hotmail/default.asp