On Wed, 24 Feb 2010, Josef Svenningsson wrote:
Hi,
I'd like some advice on how to get decent array processing speeds. jhc doesn't seem to be able to remove all the inefficiencies of the Array library interface according to my experiments. And as far as I can see jhc doesn't support any kind of unboxed arrays. Are there any other alternatives that I've missed?
I got StorableVector compiled on JHC but even simple examples did not produce runnable executables.
On Wed, Feb 24, 2010 at 12:40:02PM +0100, Henning Thielemann wrote:
On Wed, 24 Feb 2010, Josef Svenningsson wrote:
I'd like some advice on how to get decent array processing speeds. jhc doesn't seem to be able to remove all the inefficiencies of the Array library interface according to my experiments. And as far as I can see jhc doesn't support any kind of unboxed arrays. Are there any other alternatives that I've missed?
I got StorableVector compiled on JHC but even simple examples did not produce runnable executables.
In what way? I'd actually like to incorporate StorableVector into jhc's provided libraries to be the normal implementian of unboxed arrays so would be interested in what you found. John -- John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
On Wed, 24 Feb 2010, John Meacham wrote:
On Wed, Feb 24, 2010 at 12:40:02PM +0100, Henning Thielemann wrote:
I got StorableVector compiled on JHC but even simple examples did not produce runnable executables.
In what way? I'd actually like to incorporate StorableVector into jhc's provided libraries to be the normal implementian of unboxed arrays so would be interested in what you found.
I don't remember the details anymore, but JHC mail archive says: http://www.haskell.org/pipermail/jhc/2009-November/000670.html
On Thu, Feb 25, 2010 at 01:48:50PM +0100, Henning Thielemann wrote:
I don't remember the details anymore, but JHC mail archive says: http://www.haskell.org/pipermail/jhc/2009-November/000670.html
I took a look at them. For the one that was crashing, it seems to be working fine now, so it may have been caused by a bug I have fixed in darcs. The one that gets mysteriously slower is trickier, doubling up the operation causes it not to be inlined which is inhibiting strictness analysis from finding and strictifying a single call, but that one just happens to be right in the middle of the critical loop, requiring a memory allocation whereas in the singular case, the escape analysis was able to move all allocation to the stack. I don't see a quick and dirty optimization that will fix this, but there are some more advanced general purpose optimizations that will catch this case so it will eventually get fixed (probably not in the next point release though). In particular, the loop inversion optimization[1] when at least one of the parameters passed through the loop is used strictly seems like it would be a worthwhile optimization in general and would be particularly good at fixing up this loop. while I am sure gcc is performing said optimization, gcc of course can't take advantage of the exposed strictness to rewrite the allocation, not knowing anything about haskell semantics. Adding some strictness annotations to the original source would also fix this, though I hope jhc itself will be able to catch things like this on its own in the future. John [1]http://en.wikipedia.org/wiki/Loop_inversion -- John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
participants (2)
-
Henning Thielemann -
John Meacham