Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Main (main) where
- main :: IO ()
- main = do
- n1 <- {-# SCC "firstFibIO" #-} fibIO 105
- n2 <- {-# SCC "secondFibIO" #-} fibIO 205
- print n1
- print n2
- {-# SCC fibIO #-}
- fibIO :: Int -> IO Int
- fibIO n = pure $ fib2 n
- {-# SCC fib2 #-}
- fib2 :: Int -> Int
- fib2 n = ({-# SCC "infiniteRef" #-} infinite) !! n
- where
- {-# NOINLINE infinite #-}
- infinite = 1 : 1 : zipWith (+) infinite (tail infinite)
- Wed Feb 10 19:53 2021 Time and Allocation Profiling Report (Final)
- expression-profiling +RTS -P -RTS
- total time = 0.00 secs (0 ticks @ 1000 us, 1 processor)
- total alloc = 89,864 bytes (excludes profiling overheads)
- COST CENTRE MODULE SRC %time %alloc ticks bytes
- MAIN MAIN <built-in> 0.0 15.7 0 14128
- CAF GHC.IO.Handle.FD <entire-module> 0.0 38.6 0 34704
- CAF GHC.IO.Encoding <entire-module> 0.0 3.0 0 2656
- Main.fib2 Main expression-profiling.hs:22:1-4 0.0 41.4 0 37232
- individual inherited
- COST CENTRE MODULE SRC no. entries %time %alloc %time %alloc ticks bytes
- MAIN MAIN <built-in> 117 0 0.0 15.7 0.0 100.0 0 14128
- secondFibIO Main expression-profiling.hs:6:35-43 238 1 0.0 0.0 0.0 27.5 0 0
- Main.fibIO Main expression-profiling.hs:12:1-5 239 1 0.0 0.1 0.0 27.5 0 72
- Main.fib2 Main expression-profiling.hs:22:1-4 242 1 0.0 27.4 0.0 27.4 0 24616
- infiniteRef Main expression-profiling.hs:22:37-44 243 1 0.0 0.0 0.0 0.0 0 0
- CAF Main <entire-module> 233 0 0.0 0.1 0.0 14.2 0 72
- firstFibIO Main expression-profiling.hs:5:34-42 234 1 0.0 0.0 0.0 14.1 0 0
- Main.fibIO Main expression-profiling.hs:12:1-5 235 1 0.0 0.1 0.0 14.1 0 72
- Main.fib2 Main expression-profiling.hs:22:1-4 240 1 0.0 14.0 0.0 14.0 0 12616
- infiniteRef Main expression-profiling.hs:22:37-44 241 1 0.0 0.0 0.0 0.0 0 0
- CAF GHC.Conc.Signal <entire-module> 228 0 0.0 0.7 0.0 0.7 0 656
- CAF GHC.IO.Encoding <entire-module> 219 0 0.0 3.0 0.0 3.0 0 2656
- CAF GHC.IO.Encoding.Iconv <entire-module> 217 0 0.0 0.2 0.0 0.2 0 200
- CAF GHC.IO.Handle.FD <entire-module> 209 0 0.0 38.6 0.0 38.6 0 34704
- CAF GHC.IO.Handle.Text <entire-module> 148 0 0.0 0.1 0.0 0.1 0 72
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement