On Thu, 2017-03-30 at 21:51 +0200, Eduard Braun wrote:
Am 30.03.2017 um 21:33 schrieb Tavmjong Bah:
It's been known for a while that rendering when zooming in on an area with filters is slow. This is due to Inkscape breaking the canvas into tiles and rendering each tile separately.
I guess this is done to speed up rendering by panellizing the calculation? If this is true, couldn't we adjust the number of tiles relative to the number of CPU cores? (Maybe nCores * 2 or 3 in case some tiles are rendered faster than others)?
No. Actually the only parallelization we have is in the filter code. The tiling is done so that the part of the screen near the pointer is updated the fastest... which is most useful if you are editing a large drawing.
It would be interesting if we could paint multiple tiles at the same time but I have no idea how much work it would be to make that bit of the code thread safe.
If you are zoomed in so that the filter extends over the entire visible canvas, you are recalculating the filter effect 25 times.
Couldn't the result of the calculation be cached and re-used, i.e. calculate the filter once and then render all 25 tiles in parallel using the cached result?
In principle yes. We do have some caching code but I don't know how it works.
One other question: Could the tiling somehow be related to https://bugs.launchpad.net/inkscape/+bug/1656383
Probably. In trunk, if you uncomment out line 322 in src/desktop.cpp (canvas_debug) the tiles will be shown in light red.
Tav
Regards, Eduard