Ticket #74 (new enhancement)
expose the bytearray in primitive vectors
| Reported by: | choener | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Version: | Keywords: | ||
| Cc: | choener@… |
Description
This is based on our discussion regarding vector / primitive performance. Right now, in some tight loop, I see a 20% performance dropoff due to the offset being always calculated. Hence I use bytearrays directly. They are, on the other hand terribly inconvinient in some cases.
I propose a method
expose :: Vector -> ByteArray
that exposes the underlying array directly for faster indexing operations. In addition / alternatively I'd like an operation
unsafeBaseIndex :: Vector -> elm
that works like unsafeIndex but never incorporates the offset.
The reasoning is that there are cases where we always know the offset to be zero and no slicing would ever happen.
Benchmarks on vector / primitive will follow.
