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

json serialization/deserialization very slow

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.4.1
    • Fix Version/s: 5.6.1
    • Component/s: Core: I/O
    • Labels:
      None

      Description

      I'm migratinga project from qt4 to qt5, in qt4 I use this library for json serializazion/deserialization:

      https://github.com/gaudecker/qt-json

      now if I create a big variant map with something with 100.000 values, serialization in qt4 with the above library take about 400 ms and parsing less than 300 ms, using qt5 json parse about 800 ms are needed for serialization and more than 1 second for parsing, this is really slow!

      Here is the code I used for my tests:

      qtjson version:

      QByteArray json = QtJson::serialize(testMap);
      QtJson::parse(json).toMap();

      qt5 version:

      QJsonDocument doc = QJsonDocument::fromVariant(testMap);
      QByteArray json = doc.toJson(QJsonDocument::Compact);
      QJsonDocument::fromJson(json).toVariant().toMap();

      is there something wrong in my code or is qt5 json really that slow?

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              laknoll Lars Knoll
              Reporter:
              drakkan Nicola
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes