Jach's personal blog

(Largely containing a mind-dump to myselves: past, present, and future)
Current favorite quote: "Supposedly smart people are weirdly ignorant of Bayes' Rule." William B Vogt, 2010

Multicore programming with Clojure

This is really just a blurb, not a serious introduction or set of examples. A few months ago I wrote about how I prefer Python's map() to using its List Comprehensions feature even if list comprehensions look and feel more Pythonic. The main reason is because by using map, it makes it simple to extend functional code to multiple cores or machines without changing the original, just by writing a clever version of the map function.

Clojure has such a clever version built-in, called pmap. Basically, it works just like map but applies the mapper function to the input dataset in parallel. (Hence it really shines when the mapper function time dominates.) I just wanted to gush over how awesome it is. Clojure also includes a time macro that makes benchmarking easy. Check out the docs here for an example.

That's it.

Posted on 2011-10-23 by Jach

Tags: clojure, fodder, programming


Trackback URL:

Back to the top

Back to the first comment

Comment using the form below

(Only if you want to be notified of further responses, never displayed.)

Your Comment:

LaTeX allowed in comments, use $$\$\$...\$\$$$ to wrap inline and $$[math]...[/math]$$ to wrap blocks.