[Haskell-cafe] Understanding GHC allocations

2010-06-17 Thread Roman Cheplyaka
I'm trying to optimize the following program: http://github.com/feuerbach/particles/blob/303c8a17c9b732e22457b5409bdce4b7520be94a/run.hs Of course general suggestions are welcome (BTW I'm going to give a try to vector), but currently I'm concerned with two questions: 1. Heavy allocations in 'dist

Re: [Haskell-cafe] Understanding GHC allocations

2010-06-17 Thread Roman Cheplyaka
* Roman Cheplyaka [2010-06-17 12:40:59+0300] > I'm trying to optimize the following program: > http://github.com/feuerbach/particles/blob/303c8a17c9b732e22457b5409bdce4b7520be94a/run.hs > > Of course general suggestions are welcome (BTW I'm going to give a try > to vector), but currently I'm conc

Re: [Haskell-cafe] Understanding GHC allocations

2010-06-17 Thread Daniel Fischer
On Thursday 17 June 2010 11:43:09, Roman Cheplyaka wrote: > * Roman Cheplyaka [2010-06-17 12:40:59+0300] > > > I'm trying to optimize the following program: > > http://github.com/feuerbach/particles/blob/303c8a17c9b732e22457b5409bd > >ce4b7520be94a/run.hs > > > > Of course general suggestions are

Re: [Haskell-cafe] Understanding GHC allocations

2010-06-17 Thread Roman Beslik
On 17.06.10 12:40, Roman Cheplyaka wrote: > From reading core I got the impression that everything is strict& unboxed. Perhaps this is related to creating some closures? How to get rid of those allocations? Yes, "distance" creates a closure of type @Double -> Double# -> Double@ which is obvi

Re: [Haskell-cafe] Understanding GHC allocations

2010-06-17 Thread Roman Cheplyaka
* Daniel Fischer [2010-06-17 16:27:01+0200] > On Thursday 17 June 2010 11:43:09, Roman Cheplyaka wrote: > > * Roman Cheplyaka [2010-06-17 12:40:59+0300] > > > > > I'm trying to optimize the following program: > > > http://github.com/feuerbach/particles/blob/303c8a17c9b732e22457b5409bd > > >ce4b75

Re: [Haskell-cafe] Understanding GHC allocations

2010-06-17 Thread Brandon S. Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Jun 17, 2010, at 12:35 , Roman Cheplyaka wrote: That's exactly what I'm asking about. 'abs' in C does not require any allocations, does it? So why does it require any allocations in Haskell, assuming we've got no lazyness, typeclass indirection

Re: [Haskell-cafe] Understanding GHC allocations

2010-06-17 Thread Roman Beslik
On 17.06.10 19:12, Roman Beslik wrote: On 17.06.10 12:40, Roman Cheplyaka wrote: > From reading core I got the impression that everything is strict& unboxed. Perhaps this is related to creating some closures? How to get rid of those allocations? Yes, "distance" creates a closure of type @Double