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

DateTime slow performance

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Closed
    • Priority: P4: Low
    • Resolution: Invalid
    • Affects Version/s: 5.3.2
    • Fix Version/s: None
    • Component/s: Core: Date/Time
    • Labels:
      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

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

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes