aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Benchmarks/bigtable/html.hs
blob: 57a62b3a93742ef80d605d4d89870159c086a066 (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 HTML package from hackage.
--
import Text.Html
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 #-}