]> git.immae.eu Git - github/fretlink/blazeT.git/blob - src/Benchmarks/bigtable/html-minimalist.hs
Initial
[github/fretlink/blazeT.git] / src / Benchmarks / bigtable / html-minimalist.hs
1 -- | BigTable benchmark using the html-minimalist package from hackage.
2 --
3 import Text.HTML.Light hiding (map)
4 import Criterion.Main
5
6 bigTable :: [[Int]] -> String
7 bigTable t =
8 renderXHTML xhtml_1_0_strict $ html [] $ return $ table [] $ map row t
9 where
10 row r = tr [] $ map (td [] . return . cdata . show) r
11
12 main = defaultMain
13 [ bench "bigTable" $ nf bigTable myTable ]
14 where
15 rows :: Int
16 rows = 1000
17
18 myTable :: [[Int]]
19 myTable = replicate rows [1..10]
20 {-# NOINLINE myTable #-}