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

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

       

      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.

       

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

            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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes