Review Request 119539: Improve use-building timings

Milian Wolff mail at milianw.de
Wed Jul 30 00:07:59 UTC 2014


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

Ship it!


looks good, just for the future, don't forget to run benchmarks multiple times, i.e. use perf stat -r 10 or similar.


duchain/tuduchain.h
<https://git.reviewboard.kde.org/r/119539/#comment44242>

    unrelated, but please change while at it: this should be on the line above



duchain/tuduchain.h
<https://git.reviewboard.kde.org/r/119539/#comment44243>

    can you make sure that the declarations found here are never invalidated while parsing? i.e. if you find declarations from an imported file and that one gets parsed as well and the decl removed - couldn't that lead to crashes here? the declpointer would be safer, no?


- Milian Wolff


On July 30, 2014, midnight, Kevin Funk wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/119539/
> -----------------------------------------------------------
> 
> (Updated July 30, 2014, midnight)
> 
> 
> 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/b1a75649/attachment-0001.html>


More information about the KDevelop-devel mailing list