I took a look at Drawing module sources and I saw there's an internal features called batch drawing: any idea if it can be safely used for performance optimizations?
Actually I'm trying to optimize the rendering of a bunch of drawitems... at the very first they were instantiated within various datasources response callbacks and immediately drawn, but this took minutes in certain scenarios, so I tried grouping them into various DrawGroup in the hope that performance would benefit from this, but it seems useless, cause the group actually triggers a singular drawing on every item.
My plan is wrapping the draw of every group within a "batch drawing session", i.e.
so far I've played a bit with it into last SC showcase (SC Version: 10.0p Built: 2014-12-09), but I saw no noticeable performance enhancements i.e. drawing a line every 20 px on a 7000px canvas using Chrome 37.
I can provide you a working snippet if needed.
UPDATE: I expect drawing on a 7000px square canvas is really heavy, so I'm just wondering if there is any suggested alternative, such as
1. introducing instead some kind of clipping, in order to reduce the actual drawings to a smaller region near to the visible portion of the canvas... I mean something similar to what happens for listgrid (but it would introduce a log of additional complexity).
2. splitting the canvas in many slices and actually rendering only the visible ones
Actually I'm trying to optimize the rendering of a bunch of drawitems... at the very first they were instantiated within various datasources response callbacks and immediately drawn, but this took minutes in certain scenarios, so I tried grouping them into various DrawGroup in the hope that performance would benefit from this, but it seems useless, cause the group actually triggers a singular drawing on every item.
My plan is wrapping the draw of every group within a "batch drawing session", i.e.
Code:
pane.beginBatchDrawing() try { //create items and add to the group //... group.draw() } finally { pane.endBatchDrawing() }
I can provide you a working snippet if needed.
UPDATE: I expect drawing on a 7000px square canvas is really heavy, so I'm just wondering if there is any suggested alternative, such as
1. introducing instead some kind of clipping, in order to reduce the actual drawings to a smaller region near to the visible portion of the canvas... I mean something similar to what happens for listgrid (but it would introduce a log of additional complexity).
2. splitting the canvas in many slices and actually rendering only the visible ones
Comment