aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Benchmarks/bigtable/xhtml.hs
blob: 993994ca05c5dfe52352d7e61110646b6813d8a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- | BigTable benchmark using the XHTML package from hackage.
--
import Text.XHtml.Strict
import Criterion.Main

bigTable :: [[Int]] -> String
bigTable t = renderHtml $ table $ concatHtml $ map row t
  where
    row r = tr $ concatHtml $ map (td . stringToHtml . show) r

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

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