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

As a user of QTestLib, I'm concerned about the runtime effects of the unconditional toString() calls in QCOMPARE

    XMLWordPrintable

Details

    • All
    • 8
    • Team A Foundation Sprint 58
    • 0681a2dd5a (qt/qtbase/dev) 0681a2dd5a (qt/tqtc-qtbase/dev) 0681a2dd5a (qt/tqtc-qtbase/6.4)

    Description

       

      Currently, the toString() function is called for each QCOMPARE(), regardless of whether it succeeds or not, even though the result is only needed when the comparison fails. We have tens of thousands of test cases, and the string formatting eats a significant amount of the runtime compared to the (typically trivial) cost of the comparision.

      Please change QCOMPARE to only format the expressions on failure.

       

      Attachments

        Issue Links

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

          Activity

            People

              ivan.solovev Ivan Solovev
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes