aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Benchmarks/bigtable/html-minimalist.hs
blob: 2a52751eec701cc5e7f237dff23d92d2f7a6e64a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-- | BigTable benchmark using the html-minimalist package from hackage.
--
import Text.HTML.Light hiding (map)
import Criterion.Main

bigTable :: [[Int]] -> String
bigTable t =
    renderXHTML xhtml_1_0_strict $ html [] $ return $ table [] $ map row t
  where
    row r = tr [] $ map (td [] . return . cdata . show) r

main = defaultMain
    [ bench "bigTable" $ nf bigTable myTable ]
  where
    rows :: Int
    rows = 1000

    myTable :: [[Int]]
    myTable = replicate rows [1..10]
    {-# NOINLINE myTable #-}