[Haskell-cafe] Cache miss performance costs for Haskell programs?

Ramakrishnan Muthukrishnan ram at rkrishnan.org
Wed Aug 31 09:52:14 UTC 2016


On Tue, Aug 30, 2016, at 08:53 PM, Rob Stewart wrote:
> 
> Any Haskell profiling and performance tuning blog or tutorial will
> advise the use of memory space and runtime profiling, using GHC
> tooling. Far less is said about the impact of increased cache miss
> rates as program size increases.
> 
> The paper "Secrets of the Glasgow Haskell Compiler inliner", in the
> Journal of Functional Programming, July 2002, talks a lot about the
> benefits of inlining, i.e. it's part of GHCs simplifier as it enables
> many other optimisations, some that ultimately reduce program size.
> 
> Not much is said about detrimental effect that bad inlining choices
> has to runtime. The paper says: "Bloated programs are bad (increased
> compilation time, lower cache hit rates)" in Section 2.2.
> 
> I'd really like to see how badly Haskell runtimes are affected as
> cache hit rates decrease. Is anyone aware of any empirical studies, or
> papers, or blog posts, that show examples where:
> 
> For the same Haskell program, increasing inlining causes lower cache
> hit rates, which slows down runtime due to costly cycles to fetch from
> main memory more often.

Hi Rob,

Have you looked at the `perf' tool supported in recent linux kernel
versions? It seem to have tools to report cache statistics.

 <http://developers.redhat.com/blog/2014/03/10/determining-whether-an-application-has-poor-cache-performance-2/>

I haven't used it on Haskell programs though.. 

-- 
  Ramakrishnan


More information about the Haskell-Cafe mailing list