]>
Commit | Line | Data |
---|---|---|
675085c2 JG |
1 | -- | BigTable benchmark using the HTML package from hackage. |
2 | -- | |
3 | import Text.Html | |
4 | import Criterion.Main | |
5 | ||
6 | bigTable :: [[Int]] -> String | |
7 | bigTable t = renderHtml $ table $ concatHtml $ map row t | |
8 | where | |
9 | row r = tr $ concatHtml $ map (td . stringToHtml . show) r | |
10 | ||
11 | main = defaultMain | |
12 | [ bench "bigTable" $ nf bigTable myTable ] | |
13 | where | |
14 | rows :: Int | |
15 | rows = 1000 | |
16 | ||
17 | myTable :: [[Int]] | |
18 | myTable = replicate rows [1..10] | |
19 | {-# NOINLINE myTable #-} |