Skip to content

vector 0.5 is here

February 15, 2010

Version 0.5 of package vector is finally on Hackage! I was going to release it about a month ago but just never found the time. It has a lot more functionality than previous versions, is much more usable and significantly faster. Here are the main highlights:

  • DPH-style unboxed vectors (in Data.Vector.Unboxed) which use associated types to select the appropriate unboxed representation depending on the type of the elements.
  • Redesigned interface between mutable and immutable vectors. In particular, the popular unsafeFreeze primitive is now supported for all vector types.
  • Many new operations on both immutable and mutable vectors.
  • Significant performance improvements.

The release is accompanied by a new version of the NoSlow array benchmark suite which has been cleaned up and significantly extended. In particular, it now includes a couple of small array algorithms which probably provide a much better indication of overall performance than just loop kernels. Alas, I didn’t have enough time to do a lot of benchmarking but here is a graph which shows how much faster NoSlow algorithms run when using vector compared to dph-prim-seq with the current development version of GHC. Note that this shows both safe (bounds checking) and unsafe (no bounds checks) versions of the algorithms. In general, bounds checking doesn’t seem to cost much because we mostly use collective operations which don’t require any checks. However, it is rather weird that for list_rank and hyb_cc, bounds checking actually makes things faster. This probably points to a problem somewhere in the simplifier.

Data.Vector.Unboxed vs. dph-prim-seq

About these ads
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: