к
Size: a a a
ЗП
JS
ЗП
MK
AK
$ stack run --rts-options '+RTS -s'
5000000.0
2,985,529,488 bytes allocated in the heap
5,544,085,704 bytes copied during GC
891,757,168 bytes maximum residency (15 sample(s))
833,601,864 bytes maximum slop
2631 MiB total memory in use (0 MB lost due to fragmentation)
Tot time (elapsed) Avg pause Max pause
Gen 0 2625 colls, 2625 par 17.122s 6.625s 0.0025s 0.0261s
Gen 1 15 colls, 14 par 16.265s 5.922s 0.3948s 1.2558s
Parallel GC work balance: 8.28% (serial 0%, perfect 100%)
TASKS: 10 (1 bound, 9 peak workers (9 total), using -N4)
SPARKS: 0 (0 converted, 0 overflowed, 0 dud, 0 GC'd, 0 fizzled)
INIT time 0.001s ( 0.001s elapsed)
MUT time 5.771s ( 2.739s elapsed)
GC time 33.386s ( 12.547s elapsed)
EXIT time 0.002s ( 0.004s elapsed)
Total time 39.161s ( 15.290s elapsed)
Alloc rate 517,307,567 bytes per MUT second
Productivity 14.7% of total user, 17.9% of total elapsed
$ ./.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.2.1.0/build/lhHello0001-exe/lhHello0001-exe +RTS -s
5000000.0
2,985,526,136 bytes allocated in the heap
5,581,690,896 bytes copied during GC
891,757,168 bytes maximum residency (15 sample(s))
1,072,674,424 bytes maximum slop
2775 MiB total memory in use (0 MB lost due to fragmentation)
Tot time (elapsed) Avg pause Max pause
Gen 0 2625 colls, 2625 par 16.710s 5.304s 0.0020s 0.0347s
Gen 1 15 colls, 14 par 21.461s 7.281s 0.4854s 1.6621s
Parallel GC work balance: 7.25% (serial 0%, perfect 100%)
TASKS: 10 (1 bound, 9 peak workers (9 total), using -N4)
SPARKS: 0 (0 converted, 0 overflowed, 0 dud, 0 GC'd, 0 fizzled)
INIT time 0.002s ( 0.006s elapsed)
MUT time 4.480s ( 2.002s elapsed)
GC time 38.171s ( 12.585s elapsed)
EXIT time 0.144s ( 0.008s elapsed)
Total time 42.797s ( 14.600s elapsed)
Alloc rate 666,341,533 bytes per MUT second
Productivity 10.5% of total user, 13.7% of total elapsed
AK
{-# LANGUAGE BangPatterns #-}
average' :: [Integer] -> Double
average' xs = f 0 0 xs where
f ! sum ! count [] = fromIntegral sum / count
f ! sum ! count (x:xs) = f (sum+x) (count+1) xs
$ stack run --rts-options '+RTS -s'
5000000.0
2,320,166,232 bytes allocated in the heap
3,932,616 bytes copied during GC
89,784 bytes maximum residency (2 sample(s))
56,264 bytes maximum slop
5 MiB total memory in use (0 MB lost due to fragmentation)
Tot time (elapsed) Avg pause Max pause
Gen 0 2231 colls, 2231 par 0.454s 0.100s 0.0000s 0.0148s
Gen 1 2 colls, 1 par 0.001s 0.000s 0.0002s 0.0002s
Parallel GC work balance: 3.28% (serial 0%, perfect 100%)
TASKS: 10 (1 bound, 9 peak workers (9 total), using -N4)
SPARKS: 0 (0 converted, 0 overflowed, 0 dud, 0 GC'd, 0 fizzled)
INIT time 0.002s ( 0.001s elapsed)
MUT time 1.177s ( 0.898s elapsed)
GC time 0.455s ( 0.101s elapsed)
EXIT time 0.001s ( 0.010s elapsed)
Total time 1.636s ( 1.010s elapsed)
Alloc rate 1,970,541,161 bytes per MUT second
Productivity 72.0% of total user, 88.9% of total elapsed
AK
AA
AK
AA