Skip to content

Commit

Permalink
More benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnett committed Apr 16, 2017
1 parent 04b0c58 commit d973705
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions benchmark/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,18 @@ default (Int)
main :: IO ()
main = defaultMain [
-- bgroup "Grid" [bench "init" $ nf (initGrid (0.0::Double) (0.0, 1.0)) 1001]
bgroup "Grid" [bench "init" $
whnf (\np -> let g = initGrid (0.0::Double) (0.0, 1.0) np
in energyGrid g) 1001]
bgroup "Grid" [ bench "init" $
whnf (\np -> let g = initGrid (0.0::Double) (0.0, 1.0) np
in energyGrid g) 1001
, bench "rhs" $
whnf (\np -> let g = initGrid (0.0::Double) (0.0, 1.0) np
bs = bcGrid g
g' = rhsGrid bs g
in energyGrid g') 1001
, bench "rk2" $
whnf (\np -> let g = initGrid (0.0::Double) (0.0, 1.0) np
rhs x = rhsGrid (bcGrid x) x
step = rk2Grid 1.0e-8 rhs
g' = iterate step g !! 10
in energyGrid g') 1001]
]

0 comments on commit d973705

Please sign in to comment.