[Haskell-cafe] C-like Haskell

Ross Mellgren rmm-haskell at z.odi.ac
Wed Jan 28 21:09:53 EST 2009


Apparently 64-bit GHC is sufficiently advanced to be indistinguishable  
from magic. Now, if only there was a 64-bit binary for Mac OS X :-/

-Ross

On Jan 28, 2009, at 9:06 PM, Jake McArthur wrote:

> Ross Mellgren wrote:
>> Duncan, I think you must have some magics -- on my machine the  
>> original code also takes forever.
>> Running with +RTS -S indicates it's allocating several gig of  
>> memory or more.
>> Applying some bang patterns gives me ~8s for 10^8 and somewhat more  
>> than a minute for 10^9
>
> It works great for me. 64 bit, GHC 6.10.1, no bang patterns or other  
> magic. Works about the same with both Int and Int64.
>
> % time ./ctest
> 3141592649589764829
>
> real	0m2.614s
> user	0m2.610s
> sys	0m0.003s
>
> % time ./hstest
> 3141592653589764829
>
> real	0m3.878s
> user	0m3.870s
> sys	0m0.003s
>
> % ./hstest +RTS -S
> ./hstest +RTS -S
>    Alloc    Copied     Live    GC    GC     TOT     TOT  Page Flts
>    bytes     bytes     bytes  user  elap    user    elap
> 3141592653589764829
>     8512       688     17136  0.00  0.00    3.94    3.94    0    0  
> (Gen:  1)
>        0                      0.00  0.00
>
>           8,512 bytes allocated in the heap
>             688 bytes copied during GC
>          17,136 bytes maximum residency (1 sample(s))
>          19,728 bytes maximum slop
>               1 MB total memory in use (0 MB lost due to  
> fragmentation)
>
>  Generation 0:     0 collections,     0 parallel,  0.00s,  0.00s  
> elapsed
>  Generation 1:     1 collections,     0 parallel,  0.00s,  0.00s  
> elapsed
>
>  INIT  time    0.00s  (  0.00s elapsed)
>  MUT   time    3.94s  (  3.94s elapsed)
>  GC    time    0.00s  (  0.00s elapsed)
>  EXIT  time    0.00s  (  0.00s elapsed)
>  Total time    3.94s  (  3.94s elapsed)
>
>  %GC time       0.0%  (0.0% elapsed)
>
>  Alloc rate    2,158 bytes per MUT second
>
>  Productivity  99.9% of total user, 100.0% of total elapsed



More information about the Haskell-Cafe mailing list