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

DateTime slow performance

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Invalid
    • P4: Low
    • None
    • 5.3.2
    • Core: Date/Time
    • None

    Description

      There are few performances issues with QDateTime class.

      • Comparison of 2 datetimes can be very slow, even if the 2 local datetime represent the same date and time.
        For example under windows :
            QDateTime d1 = QDateTime::currentDateTime();
            qint64 ms_utc = d1.toMSecsSinceEpoch();
            QDateTime d2 = QDateTime::fromMSecsSinceEpoch(ms_utc, Qt::LocalTime, 0);
            if (d1 < d2) ...
        

        For example under linux :

            QDateTime d1 = QDateTime::currentDateTime();
            QDateTime d2 = QDateTime(d1.date(), d1.time());
            if (d1 < d2) ...
        

        The main problem here is around daylightStatus that is not set...

      • Check the validity of the datetime object is slow.
        This is normal for the first call of .isValid(), but the result should be cached for future call

      Attachments

        Issue Links

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

          Activity

            People

              Eddy Edward Welbourne
              benjarobin Benjamin Robin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes