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

Qt 6's new and improved QList fails its removeAll benchmarks

    XMLWordPrintable

Details

    • All
    • 5
    • 420dd6fcc2dad3b7cc21b75610aff613a7351b7e (qt/qtbase/6.2) 0fbeac01156c57dc6e48087b7a8dea4644294f6a (qt/qtbase/dev)
    • Team 1 Foundation_Sprint 47, Team 1 Foundation_Sprint 48

    Description

      The benchmark lies to the metatype system about some types being primitive, movable and complex (for bonus points, add tests of non-primitive, copyable but not movable) and expects this to affect how QList goes about copying, so it can count calls to copy-constructors and copy-assignment to tell whether it's being done right. This stopped working at Qt 6, presumably because of significant changes to how metatypes work and how QList decides how to do its copying.

      [4/4] Linking CXX executable qtbase/tests/benchmarks/corelib/tools/qlist/tst_bench_qlist
      ********* Start testing of tst_QList *********
      Config: Using QtTest library 6.2.0, Qt 6.2.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 10.2.1 20210110), debian 11
      PASS   : tst_QList::initTestCase()
      FAIL!  : tst_QList::removeAll_primitive(0%) Compared values are not the same
         Actual   (MyBase::liveCount)          : 10000
         Expected (isComplex ? list.size() : 0): 0
         Loc: [.../qtbase/tests/benchmarks/corelib/tools/qlist/main.cpp(303)]
      FAIL!  : tst_QList::removeAll_primitive(10%) Compared values are not the same
         Actual   (MyBase::liveCount)          : 10000
         Expected (isComplex ? list.size() : 0): 0
         Loc: [.../qtbase/tests/benchmarks/corelib/tools/qlist/main.cpp(303)]
      FAIL!  : tst_QList::removeAll_primitive(90%) Compared values are not the same
         Actual   (MyBase::liveCount)          : 10000
         Expected (isComplex ? list.size() : 0): 0
         Loc: [.../qtbase/tests/benchmarks/corelib/tools/qlist/main.cpp(303)]
      FAIL!  : tst_QList::removeAll_primitive(100%) Compared values are not the same
         Actual   (MyBase::liveCount)          : 10000
         Expected (isComplex ? list.size() : 0): 0
         Loc: [.../qtbase/tests/benchmarks/corelib/tools/qlist/main.cpp(303)]
      PASS   : tst_QList::removeAll_movable(0%)
      RESULT : tst_QList::removeAll_movable():"0%":
           0.0018 msecs per iteration (total: 61, iterations: 32768)
      FAIL!  : tst_QList::removeAll_movable(10%) Compared values are not the same
         Actual   (MyBase::errorCount): 8996
         Expected (0)                 : 0
         Loc: [.../qtbase/tests/benchmarks/corelib/tools/qlist/main.cpp(327)]
      FAIL!  : tst_QList::removeAll_movable(90%) Compared values are not the same
         Actual   (MyBase::errorCount): 1000
         Expected (0)                 : 0
         Loc: [.../qtbase/tests/benchmarks/corelib/tools/qlist/main.cpp(327)]
      PASS   : tst_QList::removeAll_movable(100%)
      RESULT : tst_QList::removeAll_movable():"100%":
           0.036 msecs per iteration (total: 75, iterations: 2048)
      PASS   : tst_QList::removeAll_complex(0%)
      RESULT : tst_QList::removeAll_complex():"0%":
           0.0018 msecs per iteration (total: 61, iterations: 32768)
      FAIL!  : tst_QList::removeAll_complex(10%) Compared values are not the same
         Actual   (MyBase::errorCount): 8996
         Expected (0)                 : 0
         Loc: [.../qtbase/tests/benchmarks/corelib/tools/qlist/main.cpp(327)]
      FAIL!  : tst_QList::removeAll_complex(90%) Compared values are not the same
         Actual   (MyBase::errorCount): 1000
         Expected (0)                 : 0
         Loc: [.../qtbase/tests/benchmarks/corelib/tools/qlist/main.cpp(327)]
      

      To reproduce: configure with -DQT_BUILD_BENCHMARKS=ON (to CMake, so after the -- option if running configure) and build; then

      ninja tst_bench_qlist && qtbase/tests/benchmarks/corelib/tools/qlist/tst_bench_qlist
      

      Observed on Debian/testing, but presumably cross-platform.

      Attachments

        Issue Links

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

          Activity

            People

              sonakur Sona Kurazyan
              Eddy Edward Welbourne
              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