Review Request 119539: Improve use-building timings

Kevin Funk kfunk at kde.org
Wed Jul 30 00:00:17 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/119539/
-----------------------------------------------------------

Review request for KDevelop.


Repository: kdev-clang


Description
-------

Improve use-building timings

Please check: The biggest bottle-neck at the moment is
ClangHelpers::findDeclaration which in turn is calling
DUContext::findContextAt millions of times for the 'benchDUChainBuilder'
bench mark.

Avoid retrieving the declaration of a cursor by caching the mapping of
those.

For this particular benchmark, I get an improvment of around 15% in both
execution time and instruction cost on my machine.


Diffs
-----

  duchain/tuduchain.h 2021c6da8197b6c5ebfc67ca7d63cabdd7968e52 
  duchain/tuduchain.cpp 5e819b2530b2748364b4db488c388a63181167ce 

Diff: https://git.reviewboard.kde.org/r/119539/diff/


Testing
-------

With lookup table (with patch applied):
 Performance counter stats for './tests/test_duchain benchDUChainBuilder':

       3473.206422 task-clock (msec)         #    0.985 CPUs utilized          
             2,092 context-switches          #    0.602 K/sec                  
                75 cpu-migrations            #    0.022 K/sec                  
            51,985 page-faults               #    0.015 M/sec                  
    10,578,241,754 cycles                    #    3.046 GHz                     [83.40%]
     7,245,909,645 stalled-cycles-frontend   #   68.50% frontend cycles idle    [83.43%]
     5,227,389,732 stalled-cycles-backend    #   49.42% backend  cycles idle    [67.17%]
     6,864,182,162 instructions              #    0.65  insns per cycle        
                                             #    1.06  stalled cycles per insn [83.58%]
     1,470,329,373 branches                  #  423.335 M/sec                   [83.05%]
        41,255,774 branch-misses             #    2.81% of all branches         [83.18%]

       3.525325050 seconds time elapsed


Without lookup table (old version):
 Performance counter stats for './tests/test_duchain benchDUChainBuilder':

       3931.375198 task-clock (msec)         #    0.989 CPUs utilized          
             2,133 context-switches          #    0.543 K/sec                  
                90 cpu-migrations            #    0.023 K/sec                  
            52,642 page-faults               #    0.013 M/sec                  
    11,969,396,458 cycles                    #    3.045 GHz                     [82.66%]
     7,977,592,042 stalled-cycles-frontend   #   66.65% frontend cycles idle    [83.47%]
     5,803,405,467 stalled-cycles-backend    #   48.49% backend  cycles idle    [67.01%]
     8,269,772,450 instructions              #    0.69  insns per cycle        
                                             #    0.96  stalled cycles per insn [83.55%]
     1,862,975,997 branches                  #  473.874 M/sec                   [83.40%]
        43,136,480 branch-misses             #    2.32% of all branches         [83.71%]

       3.976143471 seconds time elapsed


Thanks,

Kevin Funk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140730/71eddd5e/attachment.html>


More information about the KDevelop-devel mailing list