diff options
author | Csaba Hruska <csaba.hruska@gmail.com> | 2016-02-18 10:56:24 +0100 |
---|---|---|
committer | Csaba Hruska <csaba.hruska@gmail.com> | 2016-02-18 10:56:24 +0100 |
commit | 5f7bbe131b0645a74a0389172ab302e2b25ea9c7 (patch) | |
tree | 3e7b1bb946a9980e8b2f3b54e64489f9575c82b7 | |
parent | 4d920b114dd6712a7465e0c48e96440c9913ca72 (diff) |
update todo
-rw-r--r-- | TODO | 9 | ||||
-rw-r--r-- | test/PerfReport.hs | 30 |
2 files changed, 28 insertions, 11 deletions
@@ -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 | ||
92 | next: | 93 | next: |
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 | ||
303 | insert somewhere | 299 | insert 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 #-} |
2 | import Data.Char | 2 | import Data.Char |
3 | import System.Directory | 3 | import System.Directory |
4 | import System.FilePath | 4 | import System.FilePath |
5 | import Text.Printf | 5 | import Text.Printf |
6 | import Control.Monad | 6 | import Control.Monad |
7 | import Options.Applicative | ||
7 | import Data.Map (Map,(!)) | 8 | import Data.Map (Map,(!)) |
8 | import qualified Data.Map as Map | 9 | import 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 | ||
13 | resultPath = "performance" | 14 | data Config |
15 | = Config | ||
16 | { resultPath :: String | ||
17 | , output :: Maybe String | ||
18 | } | ||
14 | 19 | ||
15 | main = do | 20 | sample :: Parser Config |
21 | sample = Config | ||
22 | <$> pure "performance" | ||
23 | <*> optional (strOption (long "output" <> short 'o' <> metavar "FILENAME" <> help "output file name")) | ||
24 | |||
25 | main :: IO () | ||
26 | main = 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 | |||
33 | comparePerf :: Config -> IO () | ||
34 | comparePerf 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 | ||