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
Permalink: https://www.thejach.com/view/id/216
Trackback URL: https://www.thejach.com/view/2011/10/multicore_programming_with_clojure
Recent Posts
2024-10-04
2024-09-25
2024-09-23
2024-09-22
2024-09-02