• hi, i've been rewriting the display algorithm for gipy and i'm running into performances issues.

    i used to render the lines directly on the screen but in the new algorithm lines are rendered into intermediate images (created with Graphics.createArrayBuffer).
    these images are then drawn on the screen with g.drawImage.

    the display time is now much better. displaying a full map takes on average 0.3s even in crowded areas.
    it is a huge speed increase and i'm quite happy about it.

    however there is an issue.
    usually a tile takes around 0.015 second to render.
    sadly sometimes a tile will suddenly take 1.2 second to draw.
    it is fully deterministic, i can reproduce it 100% of the time.
    in gipy's simulator i can follow the path and when i reach point 29 i meet my slow tile.
    however, if i don't follow the path but start directly at point 26 then when i follow from there and reach 29
    then the display is as fast as usual.
    this is very weird for me because it is the same tile in both cases and the display looks identical.

    any idea why drawImage could slow down 10x suddenly ?


Avatar for wagnerf42 @wagnerf42 started