summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2016-02-18 10:56:24 +0100
committerCsaba Hruska <csaba.hruska@gmail.com>2016-02-18 10:56:24 +0100
commit5f7bbe131b0645a74a0389172ab302e2b25ea9c7 (patch)
tree3e7b1bb946a9980e8b2f3b54e64489f9575c82b7
parent4d920b114dd6712a7465e0c48e96440c9913ca72 (diff)
update todo
-rw-r--r--TODO9
-rw-r--r--test/PerfReport.hs30
2 files changed, 28 insertions, 11 deletions
diff --git a/TODO b/TODO
index 4faa9de5..ceb283ce 100644
--- a/TODO
+++ b/TODO
@@ -88,6 +88,7 @@ done:
88- backend: remove duplicate programs 88- backend: remove duplicate programs
89- support local pattern matching functions 89- support local pattern matching functions
90- support recursive local definitions 90- support recursive local definitions
91- testenv: performance benchmarks (time and memory consumption)
91 92
92next: 93next:
93- mutual recursion (inference & reduction) 94- mutual recursion (inference & reduction)
@@ -96,17 +97,12 @@ next:
96- show desugared source code on a tab in the editor 97- show desugared source code on a tab in the editor
97- names should have unique identifiers 98- names should have unique identifiers
98 99
99- testenv: performance benchmarks (time and memory consumption) 100- backend: array support
100 done - create benchmark test set (pipeline codegen and error report)
101 done - measure: runtest overall time, total time, total alloc from +RTS -tcurrent.perflog --machine-readable
102 - flag to add new result in the benchmark directory (with machine signature/name) (compare only by default)
103 - create comparison charts from the results
104 101
105- compiler: generate samplers (OpenGL 3.3) 102- compiler: generate samplers (OpenGL 3.3)
106- backend: setup texture sampler configuration (purescript) 103- backend: setup texture sampler configuration (purescript)
107- backend: setup viewport for render target size (purescript) 104- backend: setup viewport for render target size (purescript)
108 105
109- backend: array support
110- backend: GLSL codegen doesn't support Vector and tuple patterns (not compiler frontend related): 106- backend: GLSL codegen doesn't support Vector and tuple patterns (not compiler frontend related):
111 fragment02tuple 107 fragment02tuple
112 fragment02vectorpattern 108 fragment02vectorpattern
@@ -302,3 +298,4 @@ reviews, blogs
302 298
303insert somewhere 299insert somewhere
304- editor: input editor (add/edit new uniform values e.g. floats, matrixes and textures if possible) 300- editor: input editor (add/edit new uniform values e.g. floats, matrixes and textures if possible)
301- testenv: create comparison charts from the results
diff --git a/test/PerfReport.hs b/test/PerfReport.hs
index 17cbb0af..9103a2a1 100644
--- a/test/PerfReport.hs
+++ b/test/PerfReport.hs
@@ -1,18 +1,37 @@
1{-# LANGUAGE ViewPatterns, TupleSections #-} 1{-# LANGUAGE ViewPatterns, TupleSections, RecordWildCards #-}
2import Data.Char 2import Data.Char
3import System.Directory 3import System.Directory
4import System.FilePath 4import System.FilePath
5import Text.Printf 5import Text.Printf
6import Control.Monad 6import Control.Monad
7import Options.Applicative
7import Data.Map (Map,(!)) 8import Data.Map (Map,(!))
8import qualified Data.Map as Map 9import qualified Data.Map as Map
9 10
10-- HINT: lambdacube-compiler-test-suite --overall-time performance +RTS -tcurrent.log --machine-readable 11-- HINT: lambdacube-compiler-test-suite --overall-time performance +RTS -tcurrent.log --machine-readable
11-- output: current.log overall-time.txt 12-- output: current.log overall-time.txt
12 13
13resultPath = "performance" 14data Config
15 = Config
16 { resultPath :: String
17 , output :: Maybe String
18 }
14 19
15main = do 20sample :: Parser Config
21sample = Config
22 <$> pure "performance"
23 <*> optional (strOption (long "output" <> short 'o' <> metavar "FILENAME" <> help "output file name"))
24
25main :: IO ()
26main = comparePerf =<< execParser opts
27 where
28 opts = info (helper <*> sample)
29 ( fullDesc
30 <> progDesc "compares LambdaCube 3D compiper performance"
31 <> header ("LambdaCube 3D compiler performance report"))
32
33comparePerf :: Config -> IO ()
34comparePerf cfg@Config{..} = do
16 -- read current result 35 -- read current result
17 overallTime <- read <$> readFile "overall-time.txt" :: IO Double 36 overallTime <- read <$> readFile "overall-time.txt" :: IO Double
18 let toDouble = read :: String -> Double 37 let toDouble = read :: String -> Double
@@ -30,5 +49,6 @@ main = do
30 forM_ perfs $ \(name,old) -> do 49 forM_ perfs $ \(name,old) -> do
31 putStrLn $ printf "%-20s time: %+6.3f%% \tpeak mem: %+6.3f%% \ttotal alloc: %+6.3f%%" 50 putStrLn $ printf "%-20s time: %+6.3f%% \tpeak mem: %+6.3f%% \ttotal alloc: %+6.3f%%"
32 name (100*(overallTime new / overallTime old - 1)) (100*(peakAllocF new / peakAllocF old - 1)) (100*(totalAllocF new / totalAllocF old - 1)) 51 name (100*(overallTime new / overallTime old - 1)) (100*(peakAllocF new / peakAllocF old - 1)) (100*(totalAllocF new / totalAllocF old - 1))
33 --TODO 52 case output of
34 --writeFile "performance/release-0.5.perf" $ show new \ No newline at end of file 53 Nothing -> return ()
54 Just n -> writeFile (resultPath </> n ++ ".perf") $ show new