<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>PyPy (Posts about kcachegrind)</title><link>https://www.pypy.org/</link><description></description><atom:link href="https://www.pypy.org/categories/kcachegrind.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:pypy-dev@pypy.org"&gt;The PyPy Team&lt;/a&gt; </copyright><lastBuildDate>Fri, 10 Jul 2026 07:03:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Profiling for fun with valgrind</title><link>https://www.pypy.org/posts/2007/12/profiling-for-fun-with-valgrind-3215121784705288400.html</link><dc:creator>Maciej Fijalkowski</dc:creator><description>&lt;p&gt;Recently I've been doing a lot of profiling on the PyPy executables to find speed bottlenecks. &lt;a href="https://en.wikipedia.org/wiki/Valgrind"&gt;Valgrind&lt;/a&gt; (the original &lt;a href="https://valgrind.org/"&gt;page&lt;/a&gt; seems to be down) is an extremely nice tool for doing this. It has several built-in tools that give you different types of profiles. The callgrind mode provides you with a lot of information including relative call costs. The cachegrind tool gives you less information, but what it gives you (e.g. cache misses) is much more accurate. The obvious choice would be to have a way to combine the results of two profiling runs to have both. In the last days I wrote a script that does this. It's available &lt;a href="https://codespeak.net/svn/user/fijal/pygrind"&gt;at my user's svn&lt;/a&gt; and has a pretty intuitive command line interface. The combining calculation are not perfect yet, total costs of functions can still be a bit bogus (they can sum up to whatever) but at least the relative figures are good. This means that we can stop looking at two different types of graphs now.

An awesome tool for analyzing the profile data is &lt;a href="https://kcachegrind.sourceforge.net/cgi-bin/show.cgi"&gt;kcachegrind.&lt;/a&gt;

&lt;a href="https://4.bp.blogspot.com/_5R1EBmwBBTs/R2JjKRYuTTI/AAAAAAAAAAM/LX5ktu_FcIE/s1600-h/kcachegrind.png"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5143782752527469874" src="https://4.bp.blogspot.com/_5R1EBmwBBTs/R2JjKRYuTTI/AAAAAAAAAAM/LX5ktu_FcIE/s320/kcachegrind.png" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;"&gt;&lt;/a&gt;

Which also proves that my 12'' display is to small at least for some things :-).


&lt;b&gt;Update:&lt;/b&gt; pygrind is available under the MIT license.&lt;/p&gt;</description><category>kcachegrind</category><category>profiling</category><category>valgrind</category><guid>https://www.pypy.org/posts/2007/12/profiling-for-fun-with-valgrind-3215121784705288400.html</guid><pubDate>Fri, 14 Dec 2007 11:02:00 GMT</pubDate></item></channel></rss>