diff options
author | Johannes Gerer <oss@johannesgerer.com> | 2016-10-26 02:07:02 +0200 |
---|---|---|
committer | Johannes Gerer <oss@johannesgerer.com> | 2016-10-26 02:07:02 +0200 |
commit | 675085c2e0b0b851378da08b7d73024766107c87 (patch) | |
tree | 5a927de4a9576aef7e6129b96e74aa5c96f9ffb6 /src/Benchmarks/bigtable/xhtml.hs | |
download | blazeT-675085c2e0b0b851378da08b7d73024766107c87.tar.gz blazeT-675085c2e0b0b851378da08b7d73024766107c87.tar.zst blazeT-675085c2e0b0b851378da08b7d73024766107c87.zip |
Initial
Diffstat (limited to 'src/Benchmarks/bigtable/xhtml.hs')
-rw-r--r-- | src/Benchmarks/bigtable/xhtml.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Benchmarks/bigtable/xhtml.hs b/src/Benchmarks/bigtable/xhtml.hs new file mode 100644 index 0000000..993994c --- /dev/null +++ b/src/Benchmarks/bigtable/xhtml.hs | |||
@@ -0,0 +1,19 @@ | |||
1 | -- | BigTable benchmark using the XHTML package from hackage. | ||
2 | -- | ||
3 | import Text.XHtml.Strict | ||
4 | import Criterion.Main | ||
5 | |||
6 | bigTable :: [[Int]] -> String | ||
7 | bigTable t = renderHtml $ table $ concatHtml $ map row t | ||
8 | where | ||
9 | row r = tr $ concatHtml $ map (td . stringToHtml . show) r | ||
10 | |||
11 | main = 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 #-} | ||