Criterion, a new benchmarking library for Haskell

I’m pleased to announce the availability of criterion, a new library for measuring the performance of Haskell code. Compared to most other benchmarking frameworks (for any programming language, not just Haskell), criterion focuses on being easy to use, informative, and robust. Here’s a canonical benchmark-worthy function, which has the desirable properties of being both small and slow: -- Save this as a file named "Fibber.hs".import Criterion.Main (defaultMain)fib :: Int -> Intfib 0 = 0fib 1 = 1fib n = fib (n-1) + fib (n-2) To compile a program that will benchmark our fib function, we write a trivial main entry point: ...

29 September 2009 · 8 min · Bryan O'Sullivan

Riddle me this

25 September 2009 · 0 min · Bryan O'Sullivan

Video of my CUFP keynote

Thanks to the tireless work of Malcolm Wallace, all of the video from CUFP now appears to be up up Vimeo, including the keynote talk I gave. Keynote: Real world Haskell. from Malcolm Wallace on Vimeo.

23 September 2009 · 1 min · Bryan O'Sullivan

A new pseudo-random number generator for Haskell

I just released version 0.3.3 of the Haskell statistics library, which contains a very fast pseudo-random number generator. The generator is an implementation of George Marsaglia’s MWC256 multiply-with-carry PRNG, which has a period of 2^8222 (for this reason, it’s sometimes referred to as MWC8222). It produces high-quality uniformly distributed pseudo-random numbers extremely quickly. Here is a brief performance comparison between the statistics library, the mersenne-random library, the normal Haskell PRNG, and a C implementation of MWC256. The numbers represent millions of variates generated and summed per second, so higher is better. (Measured on a 64-bit Core2 Duo laptop running Fedora 11.) ...

19 September 2009 · 3 min · Bryan O'Sullivan

A video demo of my Haskell benchmarking framework

Malcolm Wallace has very kindly put a lot of work into publishing video footage from all of the talks at last week’s Haskell Implementor’s Workshop. I gave a very brief, and completely unscripted, demo of the benchmarking framework that I’ve been hacking on. This was code that I’d literally gotten working about 45 minutes before I started speaking, so it was quite the seat-of-my-pants experience. Lots of fun! Statistical benchmarking in Haskell from Malcolm Wallace on Vimeo.

14 September 2009 · 1 min · Bryan O'Sullivan

Lazy functional yak shaving in Haskell

A few weeks ago, I decided that I’d like to focus for a while on getting a 1.0 release of the Haskell text library ready. That work has gone fairly well so far. I’ve focused on making sure that I like the API, and that a few key functions have good performance characteristics. One such function is substring search, which is the underpinning for a number of useful functions (split a string on a delimiter, find all substrings, etc). My initial cut at that function had an obvious API, but ran in O(nm) time, which complexity measure I found mildly embarrassing. So I looked around for an alternative that would be faster, but still simple to implement, and settled upon Fredrik Lundh’s elegant and trim adaptation of Boyer-Moore-Sunday-Horspool, which has O(n+m) complexity in the typical case. ...

13 September 2009 · 4 min · Bryan O'Sullivan

In which I write again about revision control

Several months ago, I wrote an article on evaluating revision control systems. It was initially published in ACM Queue a few weeks ago, and the article has now made its way (unchanged) to Communications of the ACM. I’m quite happy with how it turned out, and I hope that people will find it useful in figuring out what’s important to them. Since the publication of the article, a few people have asked why I didn’t write about their favourite revision control system. The simple answer is that I was already about 50% over my initial word budget by the time I finished up what I did write. (I’ll confess that I was thoroughly charmed by a conspiratorial suggestion that I was editing some beloved tool out of history by not mentioning it.)

10 September 2009 · 1 min · Bryan O'Sullivan

Slides from my CUFP 2009 keynote talk

I was delighted to be invited to give the keynote talk at this year’s CUFP workshop in Edinburgh. My talk was this morning, and these are the slides I presented. CUFP 2009 Keynote - Real World Haskell View more documents from Bryan O'Sullivan. The video should be online some time next week, with any luck, but I hope that the slides tell a coherent story by themselves. Many thanks to Francesco Cesarini and Jim Grundy for organising such a fun day! ...

4 September 2009 · 1 min · Bryan O'Sullivan

Haskell Platform support for Fedora: we’re almost there

I spent a little time earlier today clarifying the Fedora project’s support for the Haskell Platform. You can read the details here; the summary is that we’re currently four packages short of complete support for the current release of the Haskell Platform. You can install the whole lot with a single copy-and-paste to your command line, no manual build or dependency installation required. With any luck, if we can get things complete, this will spur the Debian (and by extension, Ubuntu) Haskell team into finishing off their support for the Platform, in the spirit of friendly competition. That would leave us in the delicious situation of being able to tell curious people that almost any major Linux distro will make a good basis for developing and deploying Haskell applications. Sweet!

13 August 2009 · 1 min · Bryan O'Sullivan

First steps with Haskell text API improvement

6 July 2009 · 0 min · Bryan O'Sullivan