I used the criteria of libraries and cmdargs.
When I completely compile a program without cmdargs and run it, for example .. / prog --help, then I get some unwanted answer from the criterion about the possible options and the number of runs, etc.
When I compile and run it, as below, the command line parameters are first selected by my code, and then read by the criterion. The criterion then reports and reports that the -byte option is unknown. I did not see anything in the documentation on the criterion of how this can be disabled or bypassed. Is there a way to clear the command line options that I read? Otherwise, I will need to use, for example, CPUTime instead of the criterion, this is normal for me, since I really require downloading additional functions and data that the criterion provides.
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable #-} import System.Console.CmdArgs data Strlen = Strlen {byte :: Int} deriving (Data, Typeable, Show) strlen = cmdArgsMode $ Strlen {byte = def} &= summary "MessagePack benchmark v0.04" main = do n <- cmdArgsRun strlen let datastring = take (byte n) $ randomRs ('a','z') (mkStdGen 3) putStrLn "Starting..." conn <- connect "192.168.35.62" 8081 defaultMain [bench "sendReceive" $ whnfIO (mywl conn datastring)]
J fritsch
source share