[Haskell-cafe] bytestring vs. uvector

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Sat Mar 14 11:43:53 EDT 2009


On Tue, 2009-03-10 at 23:55 +0300, Bulat Ziganshin wrote:

> starting with 6.6, ForeignArray access is no-op, so we can just use
> obvious Ptr operations (via Storable class) to get unboxed arrays fast
> access. so, no more need for those special ByteArray# access operations
> 
> but Array library still old, so any effort based on its spources, got
> the same restrictions
> 
> also, ByteArray# may be unpinned, but afaik, this isn't really
> important - it can be coerced to Ptr for the period of one operation

Actually the fact that they may be unpinned is really important for
small allocations like short strings. Pinned allocations are slow and
lead to heap fragmentation.

Duncan



More information about the Haskell-Cafe mailing list