Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (12 sloc) 517 Bytes
import Criterion.Main
import qualified Data.ByteString.Lazy as BSL
import System.Environment
import Text.XML.Generator
gen :: Int -> IO ()
gen numberOfElems = BSL.writeFile "/tmp/test.xml" (xrender doc)
where doc = xelem "root" $ xelems $ map (\s -> xelem "foo" (xattr "key" s, xtext s)) (map show [1..numberOfElems])
main =
do args <- getArgs
case args of
"--standalone":s:[] -> gen (read s)
_ -> defaultMain (map (\i -> bench ("gen " ++ show i) (gen i)) [1000, 10000, 100000])
Jump to Line
Something went wrong with that request. Please try again.