develooper Front page | perl.perl5.porters | Postings from December 2014

Interpreting cachegrind gibberish

Thread Next
From:
Father Chrysostomos
Date:
December 28, 2014 03:20
Subject:
Interpreting cachegrind gibberish
Message ID:
20141228032013.5748.qmail@lists-nntp.develooper.com
I am trying to benchmark $x .= $y against $x = $x . $y when $x is lex-
ical.  They both optimise down to approximately the same thing, but
different code paths are taken at the start of the pp function.

I cannot use bench.pl for this, since it is for comparing one perl
against another.

Below is the output, but I do not really know what any of it means.

$ valgrind --tool=cachegrind --branch-sim=yes --cachegrind-out-file=/dev/null ./miniperl -e 'my $x; for(1..1000){ $x .= $y }'
==13418== Cachegrind, a cache and branch-prediction profiler
==13418== Copyright (C) 2002-2012, and GNU GPL'd, by Nicholas Nethercote et al.
==13418== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==13418== Command: ./miniperl -e my\ $x;\ for(1..1000){\ $x\ .=\ $y\ }
==13418== 
--13418-- warning: L3 cache found, using its data for the LL simulation.
--13418-- warning: pretending that LL cache has associativity 24 instead of actual 16
==13418== 
==13418== I   refs:      39,767,338
==13418== I1  misses:        19,363
==13418== LLi misses:         4,947
==13418== I1  miss rate:       0.04%
==13418== LLi miss rate:       0.01%
==13418== 
==13418== D   refs:       9,309,287  (6,741,805 rd   + 2,567,482 wr)
==13418== D1  misses:        11,274  (    7,471 rd   +     3,803 wr)
==13418== LLd misses:         6,490  (    3,388 rd   +     3,102 wr)
==13418== D1  miss rate:        0.1% (      0.1%     +       0.1%  )
==13418== LLd miss rate:        0.0% (      0.0%     +       0.1%  )
==13418== 
==13418== LL refs:           30,637  (   26,834 rd   +     3,803 wr)
==13418== LL misses:         11,437  (    8,335 rd   +     3,102 wr)
==13418== LL miss rate:         0.0% (      0.0%     +       0.1%  )
==13418== 
==13418== Branches:         780,834  (  763,438 cond +    17,396 ind)
==13418== Mispredicts:       56,013  (   47,565 cond +     8,448 ind)
==13418== Mispred rate:         7.1% (      6.2%     +      48.5%   )
$ valgrind --tool=cachegrind --branch-sim=yes --cachegrind-out-file=/dev/null ./miniperl -e 'my $x; for(1..1000){ $x = $x . $y }' 
==13596== Cachegrind, a cache and branch-prediction profiler
==13596== Copyright (C) 2002-2012, and GNU GPL'd, by Nicholas Nethercote et al.
==13596== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==13596== Command: ./miniperl -e my\ $x;\ for(1..1000){\ $x\ =\ $x\ .\ $y\ }
==13596== 
--13596-- warning: L3 cache found, using its data for the LL simulation.
--13596-- warning: pretending that LL cache has associativity 24 instead of actual 16
==13596== 
==13596== I   refs:      39,766,549
==13596== I1  misses:        19,409
==13596== LLi misses:         4,965
==13596== I1  miss rate:       0.04%
==13596== LLi miss rate:       0.01%
==13596== 
==13596== D   refs:       9,312,205  (6,744,413 rd   + 2,567,792 wr)
==13596== D1  misses:        11,267  (    7,469 rd   +     3,798 wr)
==13596== LLd misses:         6,493  (    3,389 rd   +     3,104 wr)
==13596== D1  miss rate:        0.1% (      0.1%     +       0.1%  )
==13596== LLd miss rate:        0.0% (      0.0%     +       0.1%  )
==13596== 
==13596== LL refs:           30,676  (   26,878 rd   +     3,798 wr)
==13596== LL misses:         11,458  (    8,354 rd   +     3,104 wr)
==13596== LL miss rate:         0.0% (      0.0%     +       0.1%  )
==13596== 
==13596== Branches:         779,209  (  761,797 cond +    17,412 ind)
==13596== Mispredicts:       56,109  (   47,652 cond +     8,457 ind)
==13596== Mispred rate:         7.2% (      6.2%     +      48.5%   )


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About