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

json serialization/deserialization very slow

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.1
    • 5.4.1
    • Core: I/O
    • 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

        For Gerrit Dashboard: QTBUG-44737
        # Subject Branch Project Status CR V

        Activity

          People

            laknoll Lars Knoll
            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