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

The efficiency of QList append method in QT6 is much lower than that in QT5

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 6.0.0
    • None
    • Windows

    Description

      Why is the efficiency of QList append method  in QT6  much lower than that in QT5?

      The average time of appending 1000000 data(ms)

        qt5.13.1 qt6.0.0
      debug 350 1300
      release 75 130
      #include <QCoreApplication>
      #include "QList"
      
      struct TradeData{
       QDateTime beginDate;
       QString exchangeID;
       double beginPrice=0;
       double endPrice=0;
       int num=0; 
      };
      
      int main(int argc, char *argv[])
      {
       QCoreApplication a(argc, argv); 
       qint64 start=QDateTime::currentMSecsSinceEpoch();
       TradeData td;
       td.begindate=QDateTime::currentDateTime();
       QList<TradeData>temp;
       for(int i=0;i<1000000;++i){
       temp.push_back(td);
       }
       qint64 interval=QDateTime::currentMSecsSinceEpoch()-start;
       std::cout<<"time:"<<interval<<std::endl;
      
      return a.exec();
      }
      

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            marsman Jiayu g
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes