Hey Devs,
I'm investigating bug lp:850992 (very hard to track down), and I notice something odd. Each time I group or ungroup two objects, the render code on DrawingItem is called many times.
I want to know if this is expected and typical behavior since we could be wasting lots of resources re-rendering the same item ever time we click on it or move it.
This is my output, some simple couts at the top of calls:
Updating DrawingItem: 0xb76e338 Updating DrawingItem: 0xb77a628 Updating DrawingItem: 0xb77a6f8 Updating DrawingItem: 0xb77b000 Updating DrawingItem: 0xe49ea08 Updating DrawingItem: 0xc93c470 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000
This is from /One/ group action. your thoughts?
Martin,
Hi Martin,
I've also seen LPE calculations being performed twice on one object move. It is definitely worth investigating what's going on. At that time it also seemed like a huge resource waste to me.
Cheers, Johan
On 22-9-2013 17:03, Martin Owens wrote:
Hey Devs,
I'm investigating bug lp:850992 (very hard to track down), and I notice something odd. Each time I group or ungroup two objects, the render code on DrawingItem is called many times.
I want to know if this is expected and typical behavior since we could be wasting lots of resources re-rendering the same item ever time we click on it or move it.
This is my output, some simple couts at the top of calls:
Updating DrawingItem: 0xb76e338 Updating DrawingItem: 0xb77a628 Updating DrawingItem: 0xb77a6f8 Updating DrawingItem: 0xb77b000 Updating DrawingItem: 0xe49ea08 Updating DrawingItem: 0xc93c470 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000
This is from /One/ group action. your thoughts?
Martin,
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clk... _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
I don't have any examples at the moment but I've seen similar things too. It would be nice to have a clear model documented on how the XML tree and SP tree interact. I am guessing that there are cases where we have circular updates. I just noticed that one of the things listed in the Roadmap is to replace direct XML manipulation with SP tree methods.
Tav
On Sun, 2013-09-22 at 17:48 +0200, Johan Engelen wrote:
Hi Martin,
I've also seen LPE calculations being performed twice on one object move. It is definitely worth investigating what's going on. At that time it also seemed like a huge resource waste to me.
Cheers, Johan
On 22-9-2013 17:03, Martin Owens wrote:
Hey Devs,
I'm investigating bug lp:850992 (very hard to track down), and I notice something odd. Each time I group or ungroup two objects, the render code on DrawingItem is called many times.
I want to know if this is expected and typical behavior since we could be wasting lots of resources re-rendering the same item ever time we click on it or move it.
This is my output, some simple couts at the top of calls:
Updating DrawingItem: 0xb76e338 Updating DrawingItem: 0xb77a628 Updating DrawingItem: 0xb77a6f8 Updating DrawingItem: 0xb77b000 Updating DrawingItem: 0xe49ea08 Updating DrawingItem: 0xc93c470 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000 Updating DrawingItem: 0xb76e338 Render DrawingItem: 0xb76e338 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render DrawingItem: 0xb77b000 Render DrawingItem: 0xe49ea08 Render DrawingItem: 0xc93c470 Render DrawingItem: 0xb77a628 Render DrawingItem: 0xb77a6f8 Render Drawing: 0xb77b000
This is from /One/ group action. your thoughts?
Martin,
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clk... _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clk... _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
I'm investigating bug lp:850992 (very hard to track down), and I notice
something odd. Each time I group or ungroup two objects, the render code on DrawingItem is called many times.
I want to know if this is expected and typical behavior since we could be
wasting lots of resources re-rendering the same item ever time we click on it or move it.
This is from /One/ group action. your thoughts?
Hi, set a breakpoint on DrawingItem::render and then press the group button. You can see how the dotted borders and those arrows around the selected items disappear in several steps and then are redrawn. Can it be that this has got to do with parallelization?
Regards, Markus
On Sun, 2013-09-22 at 17:54 +0200, Markus Engel wrote:
set a breakpoint on DrawingItem::render and then press the group button. You can see how the dotted borders and those arrows around the selected items disappear in several steps and then are redrawn. Can it be that this has got to do with parallelization?
I'm not sure what you mean. The handles are xpm from src/pixmaps/handles and are loaded at init. They're display is pretty straightforward in the selection-handler.
Do you think if the item wasn't selected and a property changed, it wouldn't take so many redraws of the same DrawingItem?
Martin,
On Sun, 2013-09-22 at 17:54 +0200, Markus Engel wrote:
set a breakpoint on DrawingItem::render and then press the group button. You can see how the dotted borders and those arrows around the selected items disappear in several steps and then are redrawn. Can it be that this has got to do with parallelization?
I'm not sure what you mean. The handles are xpm from src/pixmaps/handles and are loaded at init. They're display is pretty straightforward in the selection-handler.
Do you think if the item wasn't selected and a property changed, it wouldn't take so many redraws of the same DrawingItem?
If you set the breakpoint immediately before you press the group button, you can watch the grouping happen. Each one of these eight handles is redrawn by one call to "render", and some "dirty" areas are redrawn by the other many calls that happen. It looks to me as if the whole visible area is divided into a lot of small chunks and they are all rendered individually.
I just saw what you mean: This this-pointer is often the same. But that doesn't change the fact that each time render is called, another part of the image is redrawn.
Regards, Markus
2013/9/22 Markus Engel <p637777@...1081...>:
If you set the breakpoint immediately before you press the group button, you can watch the grouping happen. Each one of these eight handles is redrawn by one call to "render", and some "dirty" areas are redrawn by the other many calls that happen.
The handles are not drawn with DrawingItem, they are drawn by SPCtrl, defined in the file sodipodi-ctrl.h.
The display hierarchy looks like this:
- The top level object is SPCanvas, which draws on the screen using window coordinates - SPCanvas renders a tree of SPCanvasItem - Subclasses of SPCanvasItem include SPCtrl (control points), SPCtrlRect (selection rectange and page border), SPCanvasBPath (path outline) and SPCanvasText (snapping hint text) - There is a special subclass of SPCanvasItem called SPCanvasArena, which contains an Inkscape::Drawing - Inkscape::Drawing renders a tree of Inkscape::DrawingItem in document / desktop coordinates - this hierarchy is entirely independent of SPCanvasItem - Each SPItem has a method called show(), which creates the DrawingItems which visualise the SPItem on the canvas. Some DrawingItems are not visible due to being used as clipping paths or masks.
It looks to me as if the whole visible area is divided into a lot of small chunks and they are all rendered individually.
This is indeed what is happening. Under normal circumstances, the drawing area is split into vertical strips which are drawn separately to improve responsiveness. You can see those partial redraws happening when you edit an object with a large Gaussian blur.
Regards, Krzysztof
On Sun, 2013-09-22 at 17:54 +0200, Markus Engel wrote:
set a breakpoint on DrawingItem::render and then press the group button. You can see how the dotted borders and those arrows around the selected items disappear in several steps and then are redrawn. Can it be that this has got to do with parallelization?
I'm not sure what you mean. The handles are xpm from src/pixmaps/handles and are loaded at init. They're display is pretty straightforward in the selection-handler.
Do you think if the item wasn't selected and a property changed, it wouldn't take so many redraws of the same DrawingItem?
If you set the breakpoint immediately before you press the group button, you can watch the grouping happen. Each one of these eight handles is redrawn by one call to "render", and some "dirty" areas are redrawn by the other many calls that happen. It looks to me as if the whole visible area is divided into a lot of small chunks and they are all rendered individually.
I just saw what you mean: This this-pointer is often the same. But that doesn't change the fact that each time render is called, another part of the image is redrawn.
** (inkscape:25349): WARNING **: item: 0x4cb67d0; area: -272x176 ** (inkscape:25349): WARNING **: item: 0x4cb67d0; area: -192x-96 ** (inkscape:25349): WARNING **: item: 0x4cb67d0; area: -192x176 ** (inkscape:25349): WARNING **: item: 0x4cb67d0; area: -160x-80 ** (inkscape:25349): WARNING **: item: 0x4cb67d0; area: -160x176 ** (inkscape:25349): WARNING **: item: 0x4cb67d0; area: -96x-96
participants (5)
-
Johan Engelen
-
Krzysztof Kosiński
-
Markus Engel
-
Martin Owens
-
Tavmjong Bah