aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Benchmarks/bigtable/html.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Benchmarks/bigtable/html.hs')
-rw-r--r--src/Benchmarks/bigtable/html.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Benchmarks/bigtable/html.hs b/src/Benchmarks/bigtable/html.hs
new file mode 100644
index 0000000..57a62b3
--- /dev/null
+++ b/src/Benchmarks/bigtable/html.hs
@@ -0,0 +1,19 @@
1-- | BigTable benchmark using the HTML package from hackage.
2--
3import Text.Html
4import Criterion.Main
5
6bigTable :: [[Int]] -> String
7bigTable t = renderHtml $ table $ concatHtml $ map row t
8 where
9 row r = tr $ concatHtml $ map (td . stringToHtml . show) r
10
11main = 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 #-}