Skip to content

Instantly share code, notes, and snippets.

@nominolo
Created August 23, 2012 15:07
Show Gist options
  • Save nominolo/3437538 to your computer and use it in GitHub Desktop.
Save nominolo/3437538 to your computer and use it in GitHub Desktop.
Lambdachine vs GHC (microbenchmark)
$ ghc-7.0.2 -fforce-recomp -rtsopts -O2 -o ../bench-sumfromto1-100000000 tests/Bench/SumFromTo1.hs
[1 of 1] Compiling Main ( tests/Bench/SumFromTo1.hs, tests/Bench/SumFromTo1.o )
Linking ../bench-sumfromto1-100000000 ...
$ time ../bench-sumfromto1-100000000 +RTS -s -A1M
../bench-sumfromto1-100000000 +RTS -s -A1M
True
8,904,005,312 bytes allocated in the heap
550,144 bytes copied during GC
27,752 bytes maximum residency (1 sample(s))
20,520 bytes maximum slop
2 MB total memory in use (0 MB lost due to fragmentation)
Generation 0: 8491 collections, 0 parallel, 0.02s, 0.04s elapsed
Generation 1: 1 collections, 0 parallel, 0.00s, 0.00s elapsed
INIT time 0.00s ( 0.00s elapsed)
MUT time 1.83s ( 1.84s elapsed)
GC time 0.02s ( 0.04s elapsed)
EXIT time 0.00s ( 0.00s elapsed)
Total time 1.85s ( 1.87s elapsed)
%GC time 1.3% (1.9% elapsed)
Alloc rate 4,870,596,315 bytes per MUT second
Productivity 98.7% of total user, 97.6% of total elapsed
real 0m1.875s
user 0m1.852s
sys 0m0.020s
$ time ./lcvm Bench.SumFromTo1
IND -> GHC.Bool.True`con_info
8,000,489,786 bytes allocated in the heap
( 6,073,263,787 bytes per MUT second)
7887 collections
Startup 0.00s ( 395,099 ns)
LOAD 0.00s ( 255,418 ns)
Runtime 1.32s ( 1,321,318,574 ns)
MUT 1.32s ( 1,317,329,539 ns)
JIT 0.00s ( 600,396 ns)
GC 0.00s ( 3,388,639 ns)
Total 1.32s ( 1,321,713,673 ns)
%GC 0.3%
%JIT 0.0%
real 0m1.325s
user 0m1.320s
sys 0m0.000s
$ time ./lcvm --no-jit Bench.SumFromTo1
IND -> GHC.Bool.True`con_info
8,000,489,722 bytes allocated in the heap
( 552,571,498 bytes per MUT second)
7887 collections
Startup 0.00s ( 390,420 ns)
LOAD 0.00s ( 253,406 ns)
Runtime 14.48s ( 14,481,776,758 ns)
MUT 14.48s ( 14,478,650,705 ns)
JIT 0.00s ( 0 ns)
GC 0.00s ( 3,126,053 ns)
Total 14.48s ( 14,482,167,178 ns)
%GC 0.0%
%JIT 0.0%
real 0m14.485s
user 0m14.473s
sys 0m0.000s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment