> On Fri, Dec 5, 2008 at 7:04 PM, stefan kersten <[EMAIL PROTECTED]> wrote:
>
>>>> hsndfile - a recursive I/O function reads a chunk from the file (using
>>>> IOCArray type) and accumulates the maximum values from each chunk.  I
>>>> attempted to create a framework like used for HSoundFile-3, however
>>>> performance dropped dramatically; I suspect the slowdown is mostly
>>>> from the process of freezing mutable arrays to immutable arrays.
>>
>> for CArray i've been using unsafeFreezeIOCArray, which does an O(1)
>> conversion (simply keeping the pointer to the mutable array).
>

Using unsafeFreezeIOCArray and my stream implementation provides the
fastest version yet, with an average of about 1.9s per run.  This is
in the hsndfile.hs test code as function "test1".

For the record, the stream implementation and fold I'm using are
copied from Data.ByteString.Lazy.  I changed the types to suit this
code, but that's the source.

I've posted all test code I was using to
https://webspace.utexas.edu/latojw/haskell-audio/

All test files were compiled with ghc 6.10.1, with -O2 --make

HSoundFile-3 isn't entirely published yet, but for the "fromList"
function I'm using StorableVector.pack.  I'm open to suggestions.
I've thrown a tarball into the same directory, but it is currently
incomplete.

I was using:
HCodecs-0.0.3
WAVE-0.1.1
binary-0.4.4
bytestring-0.9.1.4
carray-0.1.2
hsndfile-0.3.3
storablevector-0.2.1
uvector-0.1.0.3

Cheers,
John
_______________________________________________
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art

Reply via email to