Quench debug output
Add a benchmark for Util::iconForObject.

On this machine the results are in RelWithDebInfo mode:

********* Start testing of GammaRay::BenchSuite *********
Config: Using QTest library 4.8.5, Qt 4.8.5
PASS   : GammaRay::BenchSuite::initTestCase()
RESULT : GammaRay::BenchSuite::iconForObject():
     0.118 msecs per iteration (total: 119, iterations: 1000)
PASS   : GammaRay::BenchSuite::iconForObject()
PASS   : GammaRay::BenchSuite::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of GammaRay::BenchSuite *********

 Performance counter stats for './bin/benchsuite -iterations 1000':

        288.501454 task-clock                #    0.989 CPUs utilized
               100 context-switches          #    0.347 K/sec
                10 cpu-migrations            #    0.035 K/sec
             4,937 page-faults               #    0.017 M/sec
       801,901,786 cycles                    #    2.780 GHz                     [48.88%]
   <not supported> stalled-cycles-frontend
   <not supported> stalled-cycles-backend
       796,107,314 instructions              #    0.99  insns per cycle         [74.94%]
       158,508,433 branches                  #  549.420 M/sec                   [75.72%]
         2,836,117 branch-misses             #    1.79% of all branches         [75.56%]

       0.291568304 seconds time elapsed
Add a benchmark for ConnectionModel::connectionAdded

********* Start testing of GammaRay::BenchSuite *********
Config: Using QTest library 4.8.5, Qt 4.8.5
PASS   : GammaRay::BenchSuite::initTestCase()
RESULT : GammaRay::BenchSuite::connectionModel_connectionAdded():
     31.6 msecs per iteration (total: 316, iterations: 10)
PASS   : GammaRay::BenchSuite::connectionModel_connectionAdded()
PASS   : GammaRay::BenchSuite::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of GammaRay::BenchSuite *********

 Performance counter stats for './bin/benchsuite connectionModel_connectionAdded -iterations 10':

       1570.319773 task-clock                #    0.971 CPUs utilized
               307 context-switches          #    0.196 K/sec
                 5 cpu-migrations            #    0.003 K/sec
            22,992 page-faults               #    0.015 M/sec
     4,430,538,602 cycles                    #    2.821 GHz                     [51.06%]
   <not supported> stalled-cycles-frontend
   <not supported> stalled-cycles-backend
     6,294,737,807 instructions              #    1.42  insns per cycle         [74.76%]
     1,578,752,430 branches                  # 1005.370 M/sec                   [74.53%]
        12,288,578 branch-misses             #    0.78% of all branches         [74.53%]

       1.617367794 seconds time elapsed
Add a benchmark for ConnectionModel::connectionRemoved.

********* Start testing of GammaRay::BenchSuite *********
Config: Using QTest library 4.8.5, Qt 4.8.5
PASS   : GammaRay::BenchSuite::initTestCase()
RESULT : GammaRay::BenchSuite::connectionModel_connectionRemoved():
     2,227 msecs per iteration (total: 2,227, iterations: 1)
PASS   : GammaRay::BenchSuite::connectionModel_connectionRemoved()
PASS   : GammaRay::BenchSuite::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of GammaRay::BenchSuite *********

 Performance counter stats for './bin/benchsuite connectionModel_connectionRemoved':

       4681.261065 task-clock                #    0.993 CPUs utilized
               613 context-switches          #    0.131 K/sec
                13 cpu-migrations            #    0.003 K/sec
            12,757 page-faults               #    0.003 M/sec
    13,203,128,557 cycles                    #    2.820 GHz                     [49.92%]
   <not supported> stalled-cycles-frontend
   <not supported> stalled-cycles-backend
     5,510,020,469 instructions              #    0.42  insns per cycle         [74.93%]
       995,768,282 branches                  #  212.714 M/sec                   [75.03%]
         4,682,532 branch-misses             #    0.47% of all branches         [75.08%]

       4.712136358 seconds time elapsed
Add a benchmark for Probe::objectAdded.

********* Start testing of GammaRay::BenchSuite *********
Config: Using QTest library 4.8.5, Qt 4.8.5
PASS   : GammaRay::BenchSuite::initTestCase()
RESULT : GammaRay::BenchSuite::probe_objectAdded():
     165 msecs per iteration (total: 165, iterations: 1)
PASS   : GammaRay::BenchSuite::probe_objectAdded()
PASS   : GammaRay::BenchSuite::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of GammaRay::BenchSuite *********

 Performance counter stats for './bin/benchsuite probe_objectAdded':

        883.391216 task-clock                #    0.997 CPUs utilized
               160 context-switches          #    0.181 K/sec
                11 cpu-migrations            #    0.012 K/sec
            14,038 page-faults               #    0.016 M/sec
     2,478,326,760 cycles                    #    2.805 GHz                     [50.12%]
   <not supported> stalled-cycles-frontend
   <not supported> stalled-cycles-backend
     4,005,802,754 instructions              #    1.62  insns per cycle         [75.13%]
     1,093,232,521 branches                  # 1237.541 M/sec                   [75.16%]
         7,430,056 branch-misses             #    0.68% of all branches         [74.89%]

       0.886268067 seconds time elapsed
Optimize Util::iconForObject which was a big performance drain before.

We now parse the resource file only once and save tons of string
allocations and pixmap creations whenever we lookup the icon for
an object.

The performance speedup is in the order of two magnitudes.

********* Start testing of GammaRay::BenchSuite *********
Config: Using QTest library 4.8.5, Qt 4.8.5
PASS   : GammaRay::BenchSuite::initTestCase()
RESULT : GammaRay::BenchSuite::iconForObject():
     0.001 msecs per iteration (total: 1, iterations: 1000)
PASS   : GammaRay::BenchSuite::iconForObject()
PASS   : GammaRay::BenchSuite::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of GammaRay::BenchSuite *********

 Performance counter stats for './bin/benchsuite iconForObject -iterations 1000':

         50.157281 task-clock                #    0.947 CPUs utilized
                74 context-switches          #    0.001 M/sec
                11 cpu-migrations            #    0.219 K/sec
             4,951 page-faults               #    0.099 M/sec
       135,731,776 cycles                    #    2.706 GHz                     [48.98%]
   <not supported> stalled-cycles-frontend
   <not supported> stalled-cycles-backend
       147,084,763 instructions              #    1.08  insns per cycle         [73.73%]
        30,924,367 branches                  #  616.548 M/sec                   [74.13%]
           753,635 branch-misses             #    2.44% of all branches         [78.74%]

       0.052941882 seconds time elapsed
Optimize ConnectionModel::connectionRemoved by two orders of magnitude

QVector in Qt4 does not move objects when erasing, even though
Connection is marked as movable. To workaround this issue, we swap
with the last entry and pop from the back which is cheap.

********* Start testing of GammaRay::BenchSuite *********
Config: Using QTest library 4.8.5, Qt 4.8.5
PASS   : GammaRay::BenchSuite::initTestCase()
RESULT : GammaRay::BenchSuite::connectionModel_connectionRemoved():
     95 msecs per iteration (total: 95, iterations: 1)
PASS   : GammaRay::BenchSuite::connectionModel_connectionRemoved()
PASS   : GammaRay::BenchSuite::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of GammaRay::BenchSuite *********

 Performance counter stats for './bin/benchsuite connectionModel_connectionRemoved':

        404.448500 task-clock                #    0.991 CPUs utilized
               112 context-switches          #    0.277 K/sec
                 6 cpu-migrations            #    0.015 K/sec
            12,756 page-faults               #    0.032 M/sec
     1,138,930,126 cycles                    #    2.816 GHz                     [49.29%]
   <not supported> stalled-cycles-frontend
   <not supported> stalled-cycles-backend
     1,464,750,989 instructions              #    1.29  insns per cycle         [74.73%]
       367,314,247 branches                  #  908.185 M/sec                   [75.32%]
         4,651,435 branch-misses             #    1.27% of all branches         [75.41%]

       0.408093680 seconds time elapsed
Optimize: Save QByteArray allocation in checkMethoForObject.

********* Start testing of GammaRay::BenchSuite *********
Config: Using QTest library 4.8.5, Qt 4.8.5
PASS   : GammaRay::BenchSuite::initTestCase()
RESULT : GammaRay::BenchSuite::connectionModel_connectionAdded():
     26.8 msecs per iteration (total: 268, iterations: 10)
PASS   : GammaRay::BenchSuite::connectionModel_connectionAdded()
PASS   : GammaRay::BenchSuite::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of GammaRay::BenchSuite *********

 Performance counter stats for './bin/benchsuite connectionModel_connectionAdded -iterations 10':

       1499.063378 task-clock                #    0.998 CPUs utilized
               221 context-switches          #    0.147 K/sec
                10 cpu-migrations            #    0.007 K/sec
            22,886 page-faults               #    0.015 M/sec
     4,221,294,746 cycles                    #    2.816 GHz                     [50.15%]
   <not supported> stalled-cycles-frontend
   <not supported> stalled-cycles-backend
     6,122,453,747 instructions              #    1.45  insns per cycle         [75.11%]
     1,529,247,011 branches                  # 1020.135 M/sec                   [75.16%]
        10,914,840 branch-misses             #    0.71% of all branches         [74.78%]

       1.502786257 seconds time elapsed
Optimize: Use normalized signature in connectionRemoved.

********* Start testing of GammaRay::BenchSuite *********
Config: Using QTest library 4.8.5, Qt 4.8.5
PASS   : GammaRay::BenchSuite::initTestCase()
RESULT : GammaRay::BenchSuite::connectionModel_connectionRemoved():
     85 msecs per iteration (total: 85, iterations: 1)
PASS   : GammaRay::BenchSuite::connectionModel_connectionRemoved()
PASS   : GammaRay::BenchSuite::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of GammaRay::BenchSuite *********

 Performance counter stats for './bin/benchsuite connectionModel_connectionRemoved':

        375.060442 task-clock                #    0.988 CPUs utilized
               114 context-switches          #    0.304 K/sec
                 8 cpu-migrations            #    0.021 K/sec
            12,755 page-faults               #    0.034 M/sec
     1,044,530,002 cycles                    #    2.785 GHz                     [50.16%]
   <not supported> stalled-cycles-frontend
   <not supported> stalled-cycles-backend
     1,374,924,808 instructions              #    1.32  insns per cycle         [75.33%]
       344,629,356 branches                  #  918.864 M/sec                   [75.20%]
         4,141,258 branch-misses             #    1.20% of all branches         [75.01%]

       0.379719371 seconds time elapsed
Optimize ObjectListModel.

- use a plain non-recursive QMutex
- use sorted list of objects and binary search which then
is O(log(N)) instead of O(N).
- save string allocations, esp. by using normalized signatures
for invokeMethod
- directly call main thread if possible, that is faster

********* Start testing of GammaRay::BenchSuite *********
Config: Using QTest library 4.8.5, Qt 4.8.5
PASS   : GammaRay::BenchSuite::initTestCase()
RESULT : GammaRay::BenchSuite::probe_objectAdded():
     120 msecs per iteration (total: 120, iterations: 1)
PASS   : GammaRay::BenchSuite::probe_objectAdded()
PASS   : GammaRay::BenchSuite::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of GammaRay::BenchSuite *********

 Performance counter stats for './bin/benchsuite probe_objectAdded':

        553.320891 task-clock                #    0.991 CPUs utilized
               131 context-switches          #    0.237 K/sec
                 9 cpu-migrations            #    0.016 K/sec
            14,029 page-faults               #    0.025 M/sec
     1,534,370,447 cycles                    #    2.773 GHz                     [50.22%]
   <not supported> stalled-cycles-frontend
   <not supported> stalled-cycles-backend
     2,000,457,718 instructions              #    1.30  insns per cycle         [75.50%]
       475,340,321 branches                  #  859.068 M/sec                   [75.57%]
         5,104,675 branch-misses             #    1.07% of all branches         [74.39%]

       0.558526597 seconds time elapsed
Comment out invalid line.
Optimize ObjectTreeModel for items with many children.

Use sorted list of children and binary search, i.e.
O(log(N)) instead of O(N) algorithms.

********* Start testing of GammaRay::BenchSuite *********
Config: Using QTest library 4.8.5, Qt 4.8.5
PASS   : GammaRay::BenchSuite::initTestCase()
RESULT : GammaRay::BenchSuite::probe_objectAdded():
     89 msecs per iteration (total: 89, iterations: 1)
PASS   : GammaRay::BenchSuite::probe_objectAdded()
PASS   : GammaRay::BenchSuite::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of GammaRay::BenchSuite *********

 Performance counter stats for './bin/benchsuite probe_objectAdded':

        460.861085 task-clock                #    0.994 CPUs utilized
               120 context-switches          #    0.260 K/sec
                 7 cpu-migrations            #    0.015 K/sec
            14,029 page-faults               #    0.030 M/sec
     1,294,595,430 cycles                    #    2.809 GHz                     [49.61%]
   <not supported> stalled-cycles-frontend
   <not supported> stalled-cycles-backend
     1,503,463,540 instructions              #    1.16  insns per cycle         [74.73%]
       277,569,384 branches                  #  602.284 M/sec                   [75.37%]
         5,317,594 branch-misses             #    1.92% of all branches         [75.27%]

       0.463514742 seconds time elapsed
Opt: Use normalized function signature to prevent string allocations.

********* Start testing of GammaRay::BenchSuite *********
Config: Using QTest library 4.8.5, Qt 4.8.5
PASS   : GammaRay::BenchSuite::initTestCase()
RESULT : GammaRay::BenchSuite::probe_objectAdded():
     74 msecs per iteration (total: 74, iterations: 1)
PASS   : GammaRay::BenchSuite::probe_objectAdded()
PASS   : GammaRay::BenchSuite::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of GammaRay::BenchSuite *********

 Performance counter stats for './bin/benchsuite probe_objectAdded':

        453.356424 task-clock                #    0.992 CPUs utilized
               119 context-switches          #    0.262 K/sec
                 7 cpu-migrations            #    0.015 K/sec
            14,068 page-faults               #    0.031 M/sec
     1,272,394,142 cycles                    #    2.807 GHz                     [50.11%]
   <not supported> stalled-cycles-frontend
   <not supported> stalled-cycles-backend
     1,467,338,055 instructions              #    1.15  insns per cycle         [75.06%]
       268,987,911 branches                  #  593.325 M/sec                   [75.26%]
         5,290,137 branch-misses             #    1.97% of all branches         [74.69%]

       0.457026761 seconds time elapsed
Optimize: Save calls to normalizedSignature.

If the signature is normalized, use that directly.

********* Start testing of GammaRay::BenchSuite *********
Config: Using QTest library 4.8.5, Qt 4.8.5
PASS   : GammaRay::BenchSuite::initTestCase()
RESULT : GammaRay::BenchSuite::connectionModel_connectionAdded():
     21.5 msecs per iteration (total: 215, iterations: 10)
PASS   : GammaRay::BenchSuite::connectionModel_connectionAdded()
PASS   : GammaRay::BenchSuite::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of GammaRay::BenchSuite *********

 Performance counter stats for './bin/benchsuite connectionModel_connectionAdded -iterations 10':

        940.726913 task-clock                #    0.997 CPUs utilized
               162 context-switches          #    0.172 K/sec
                10 cpu-migrations            #    0.011 K/sec
            23,056 page-faults               #    0.025 M/sec
     2,644,853,466 cycles                    #    2.811 GHz                     [50.02%]
   <not supported> stalled-cycles-frontend
   <not supported> stalled-cycles-backend
     2,984,836,172 instructions              #    1.13  insns per cycle         [75.18%]
       585,736,023 branches                  #  622.642 M/sec                   [74.90%]
         6,377,105 branch-misses             #    1.09% of all branches         [75.21%]

       0.943833984 seconds time elapsed
Merge pull request #58 from KDAB/performance_improvements

Performance improvements