HTML5 Stroke VERY Slow in Qt 5.x



  • It appears that the HTML5 stroke() operation in Qt5 is very slow.

    I downloaded a number of the canned Qt's, such as qt-windows-opensource-5.1.1-msvc2010_opengl-x86-offline, and then ran the following test script,
    @ function drawLine(num_pts) {
    var c = document.getElementById("my_canvas");
    var ctx = c.getContext("2d");

        var h = c.height;
        var w = c.width;
        var dx = w / num_pts;
        for (var idx=0; idx<num_pts; ++idx) {
            var x = idx * dx;
            var y = h * Math.random();
            if (idx === 0) {
                ctx.moveTo(x,y);
            } else {
                ctx.lineTo(x,y);
            }
        }
        ctx.lineTo(w, h / 2);
        ctx.stroke();
    }
    
    drawLine(10000);
    

    @

    In Chrome this takes about 7 milliseconds. In Qt, using the FancyBrowser example, it takes about 30,000ms. Even worse, if I repeatedly run the example its runtime degrades with each attempt, tacking on 20,000ms per attempt or so. I'm able to reproduce this w/ the download bundle for Qt 5.0, 5.1.1, and 5.2, with or without OpenGL support, whether Release or Debug build (albeit, Debug is yet slower).

    Does anybody know what's going on? Oddly, it runs at a much more reasonable speed (though still an order of magnitude worse than Chrome) using the Qt 4.84 and 4.8.5 bundles. (I originally ran into this issue in a binary built against 4.8.4, and was hopeful 5 would fix it, so was troubled to see the problem in 5. I'm not yet sure why I'm seeing it in my Qt 4.8.4 binary but not the 4.8.4 bundled examples.)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.