File: Benchmark.hs

package info (click to toggle)
haskell-jmacro 0.6.18-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 224 kB
  • sloc: haskell: 1,885; makefile: 4
file content (11 lines) | stat: -rw-r--r-- 365 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
{-# LANGUAGE QuasiQuotes #-}

import Criterion.Main
import Language.Javascript.JMacro
import Text.PrettyPrint.Leijen.Text (renderPretty, renderCompact, displayT)

main = defaultMain [pretty, compact]

pretty = bench "pretty" $ nf (displayT . renderPretty 0.4 100 . renderJs) jmPrelude

compact = bench "compact" $ nf (displayT . renderCompact . renderJs) jmPrelude