draw2d
draw2d copied to clipboard
Performance in Reader.js/add
Hi. First I'd like to thank you for your great work. Your library is the best IMO from functional POV.
I hit however wall with loading drawing via json/Reader.js It takes 30 sec to load a meaningfully complicated drawing.
Profiler complains about node.getBBox() forcing reflow.
I profiled it in Chrome and 99% most of the time is spent in canvas.add (line 105 in json/Reader.js in my version - 101)
I tried throwing fastdom.mutate/measure around and around whole unmarshal method to now avail.
So I come here begging for help :)
Cheers Nick
I'm trying to draw a scheme for my research project, which has 500 elements. Drawing itself takes more than 5 minutes. I wanted to ask your advice what can be done to speed up the rendering. Thank.
Hello, same probleme, is there a way to commit during all the multiple add , i got like 1200 element to draw.
Same problem, also when I drag a big node with more than 20 child nodes, drag is not smoth but just shows the last state where drag ended. What's the root cause? can we remove some unnecessary listners that may help?
same here
Any progress for this?
i don't know if this can help, but i noticed this piece of code in cavas.js:
https://github.com/freegroup/draw2d/blob/5b1b8201ca535bca4365fe4dd8cbd7dd804d4515/src/Canvas.js#L921-L930
For each connection in json, all lines are repainted (every time), so the more connections in json the more time it will take. Using draw2d.Connection and SplineConnectionRouter as router, I would have expected it not to be executed. Maybe this can be changed with a check on router actually used.
The same thing happens here (but once):
https://github.com/freegroup/draw2d/blob/master/src/io/json/Reader.js#L126-L133