diff --git a/testsuite/lpgf/README.md b/testsuite/lpgf/README.md index 67ed82486..4a02416fd 100644 --- a/testsuite/lpgf/README.md +++ b/testsuite/lpgf/README.md @@ -28,7 +28,8 @@ Comparing PGF, PGF2, LPGF along following criteria: ### Running ``` -stack build --test --bench --no-run-tests --no-run-benchmarks && time stack bench -stack build --test --bench --no-run-tests --no-run-benchmarks && time PGF_ONLY=1 stack bench -stack build --test --bench --no-run-tests --no-run-benchmarks && time LPGF_ONLY=1 stack bench +stack build --test --bench --no-run-tests --no-run-benchmarks +stack bench --benchmark-arguments "+RTS -T -RTS" +PGF_ONLY=1 stack bench --benchmark-arguments "+RTS -T -RTS" +LPGF_ONLY=1 stack bench --benchmark-arguments "+RTS -T -RTS" ``` diff --git a/testsuite/lpgf/bench.hs b/testsuite/lpgf/bench.hs index 16e76b117..65dc96e6b 100644 --- a/testsuite/lpgf/bench.hs +++ b/testsuite/lpgf/bench.hs @@ -19,6 +19,8 @@ import System.Environment (lookupEnv) import System.FilePath ((), takeBaseName, takeExtension) import Text.Printf (printf) +import GHC.Stats + dir :: FilePath dir = "testsuite" "lpgf" @@ -61,6 +63,10 @@ main = do time "linearise LPGF" (return $ length $ linLPGF lpgf trees) return () + stats <- getRTSStats + printf "Max live memory: %s\n" (convertSize (read (show (max_live_bytes stats)))) + printf "Max used memory: %s\n" (convertSize (read (show (max_mem_in_use_bytes stats)))) + time :: String -> IO a -> IO a time desc io = do start <- getCurrentTime