Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-94896

QML MapView performance issue

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.0 RC2
    • None
    • Windows

    Description

      Using a MapView with a large number of MapItem (MapQuickItem,MapPolyLine) takes a long time for initial rendering on a Labtop (2 cores, 2.5 Ghz, 8 MB RAM).

           5000*(node + edge + node) takes 12171ms

           10000 (node + edge + node) takes *24979ms

      The documentation says : Maps are rendered using OpenGL (ES) and the Qt Scene Graph stack, and as a result perform quite well where GL accelerated hardware is available

      In our case , the GPU activity seems low, but the CPU seems to be used intensively.

      The tool OpenGL extension viewer indicate that OPENGL is available (any advice is welcome).

      Some users report that starting with window minimized improve the performances.

      Our application uses QAbstractItemModel, but to submit a test with a simple example, we use Qt.createQmlObject to instanciate all items.

      Regards

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtLocation 5.12
      import QtPositioning 5.12

      Window {
      id : app
      width: Screen.width
      height: Screen.height
      visible: true
      property int nbEdges : 10000
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Plugin

      { id : osmPlugin name: "osm" PluginParameter \{ name: "osm.mapping.host"; value: "http://tile.openstreetmap.org/" }

      PluginParameter { name: "osm.mapping.providersrepository.disabled"; value: "true" }
      }
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Plugin

      { id : offlinePlugin name: "osm" PluginParameter \{ name: "osm.mapping.offline.directory"; value: "."}

      }
      property string mqi:'import QtQuick 2.0;import QtLocation 5.3;
      MapQuickItem {zoomLevel : map.zoomLevel < 16 ? 16:0;
      anchorPoint.x: shape.x+shape.width/2;anchorPoint.y: shape.y+shape.height/2;
      sourceItem:Rectangle {id:shape;width: 10;height: width;color: "yellow";radius: width; border.width : 1
      MouseArea{anchors.fill:parent;onClicked:{console.log("clicked")}}}}'

      property string mpl:'import QtQuick 2.0;import QtLocation 5.3;MapPolyline {}'

      Map {
      id: map
      anchors.fill: parent
      plugin: offlinePlugin
      center: QtPositioning.coordinate(45.200744,5.703549) // Grenoble
      zoomLevel: 14
      property MapQuickItem node1
      property MapQuickItem node2
      property MapPolyline edge

      function getRandom(max)

      { return Math.random() * max; }

      Component.onCompleted: {
      console.time("MapBench")
      for(var i=0;i<nbEdges;i++)

      { // edge edge = Qt.createQmlObject(mpl, app) // first node node1 = Qt.createQmlObject(mqi, app) node1.coordinate = QtPositioning.coordinate(45.120744+getRandom(0.1),5.673549+getRandom(0.1)) map.addMapItem(node1) edge.addCoordinate(node1.coordinate) // second node node2 = Qt.createQmlObject(mqi, app) node2.coordinate = QtPositioning.coordinate(node1.coordinate.latitude+getRandom(0.001), node1.coordinate.longitude+getRandom(0.001)) edge.addCoordinate(node2.coordinate) map.addMapItem(node2) map.addMapItem(edge) }

      console.timeEnd("MapBench")
      }
      }
      }

      Attachments

        1. Perf.png
          Perf.png
          9 kB
        2. GLViewer.png
          GLViewer.png
          75 kB

        Activity

          People

            paangele Paolo Angelelli
            mani ROUAULT GUY
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: