From 83fdd5805ef0ff21bd60a80b48d834f8092274a6 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sat, 6 Aug 2022 14:50:31 +0000 Subject: [PATCH 1/8] fix lsp-types paths --- ghcide/bench/config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghcide/bench/config.yaml b/ghcide/bench/config.yaml index bcec13dfbe..a4ca3d616c 100644 --- a/ghcide/bench/config.yaml +++ b/ghcide/bench/config.yaml @@ -37,13 +37,13 @@ examples: package: lsp-types version: 1.5.0.0 modules: - - src/Language/LSP/VFS.hs + - src/Language/LSP/Types/Uri.hs - src/Language/LSP/Types/Lens.hs - name: lsp-types-conservative package: lsp-types version: 1.5.0.0 modules: - - src/Language/LSP/VFS.hs + - src/Language/LSP/Types/Uri.hs - src/Language/LSP/Types/Lens.hs extra-args: - --conservative-change-tracking From c76ec9afad8c68b7a992e804e5104f3bdfdd14d1 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sun, 7 Aug 2022 23:32:11 +0200 Subject: [PATCH 2/8] Fail if there are no documents to benchmark --- ghcide/bench/lib/Experiments.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ghcide/bench/lib/Experiments.hs b/ghcide/bench/lib/Experiments.hs index df58577e6c..49b6ffd414 100644 --- a/ghcide/bench/lib/Experiments.hs +++ b/ghcide/bench/lib/Experiments.hs @@ -72,8 +72,13 @@ data DocumentPositions = DocumentPositions { doc :: !TextDocumentIdentifier } -allWithIdentifierPos :: Monad m => (DocumentPositions -> m Bool) -> [DocumentPositions] -> m Bool -allWithIdentifierPos f docs = allM f (filter (isJust . identifierP) docs) +allWithIdentifierPos :: MonadFail m => (DocumentPositions -> m Bool) -> [DocumentPositions] -> m Bool +allWithIdentifierPos f docs = case applicableDocs of + -- fail if there are no documents to benchmark + [] -> fail "None of the example modules have identifier positions" + docs' -> allM f docs' + where + applicableDocs = filter (isJust . identifierP) docs experiments :: [Bench] experiments = From 2a8ef28362bd762e3c00b749d6c65024eefa8df4 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sun, 7 Aug 2022 23:32:22 +0200 Subject: [PATCH 3/8] use modules with suitable positions --- ghcide/bench/config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ghcide/bench/config.yaml b/ghcide/bench/config.yaml index a4ca3d616c..a744f56e17 100644 --- a/ghcide/bench/config.yaml +++ b/ghcide/bench/config.yaml @@ -37,14 +37,14 @@ examples: package: lsp-types version: 1.5.0.0 modules: - - src/Language/LSP/Types/Uri.hs - - src/Language/LSP/Types/Lens.hs + - src/Language/LSP/Types/WatchedFiles.hs + - src/Language/LSP/Types/CallHierarchy.hs - name: lsp-types-conservative package: lsp-types version: 1.5.0.0 modules: - - src/Language/LSP/Types/Uri.hs - - src/Language/LSP/Types/Lens.hs + - src/Language/LSP/Types/WatchedFiles.hs + - src/Language/LSP/Types/CallHierarchy.hs extra-args: - --conservative-change-tracking # Small-sized project with TH From 2ae876621a9995ccb82651fcf406e3b31196ff1a Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sat, 13 Aug 2022 09:53:06 +0200 Subject: [PATCH 4/8] Fix 8.6.5 build --- ghcide/bench/lib/Experiments.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/ghcide/bench/lib/Experiments.hs b/ghcide/bench/lib/Experiments.hs index 49b6ffd414..e568cd3878 100644 --- a/ghcide/bench/lib/Experiments.hs +++ b/ghcide/bench/lib/Experiments.hs @@ -25,6 +25,7 @@ module Experiments import Control.Applicative.Combinators (skipManyTill) import Control.Exception.Safe (IOException, handleAny, try) import Control.Monad.Extra +import Control.Monad.Fail import Control.Monad.IO.Class import Data.Aeson (Value (Null), toJSON) import Data.Either (fromRight) From 159f38139fcfef5e839fe1256a2d4cfe1b5816a2 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sun, 14 Aug 2022 16:01:53 +0200 Subject: [PATCH 5/8] fix imports for 8.6.5 --- ghcide/bench/lib/Experiments.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ghcide/bench/lib/Experiments.hs b/ghcide/bench/lib/Experiments.hs index e568cd3878..3af4f5f416 100644 --- a/ghcide/bench/lib/Experiments.hs +++ b/ghcide/bench/lib/Experiments.hs @@ -24,8 +24,9 @@ module Experiments ) where import Control.Applicative.Combinators (skipManyTill) import Control.Exception.Safe (IOException, handleAny, try) -import Control.Monad.Extra -import Control.Monad.Fail +import Control.Monad.Extra + ( forM_, void, unless, forM, (&&^), allM, whenJust ) +import Control.Monad.Fail (MonadFail) import Control.Monad.IO.Class import Data.Aeson (Value (Null), toJSON) import Data.Either (fromRight) From 036a41c6a9200de9a568eea3800716a4c9500755 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sun, 14 Aug 2022 17:42:59 +0200 Subject: [PATCH 6/8] Fix benchmark artifact uploads --- .github/workflows/bench.yml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 1691ca2152..78dc28b56b 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -140,24 +140,32 @@ jobs: run: | column -s, -t < ghcide/bench-results/unprofiled/${{ matrix.example }}/results.csv | tee ghcide/bench-results/unprofiled/${{ matrix.example }}/results.txt + - name: tar benchmarking artifacts + run: | + tar -czf benchmark-artifacts.tar.gz \ + ghcide/bench-results/results.* \ + ghcide/bench-results/**/*.csv \ + ghcide/bench-results/**/*.svg \ + ghcide/bench-results/**/*.eventlog.html + - name: Archive benchmarking artifacts uses: actions/upload-artifact@v3 with: name: bench-results-${{ runner.os }}-${{ matrix.ghc }} - path: | - ghcide/bench-results/results.* - ghcide/bench-results/**/*.csv - ghcide/bench-results/**/*.svg - ghcide/bench-results/**/*.eventlog.html + path: benchmark-artifacts.tar.gz + + - name: tar benchmarking logs + run: | + tar -czf benchmark-logs.tar.gz \ + ghcide/bench-results/**/*.log \ + ghcide/bench-results/**/*.eventlog \ + ghcide/bench-results/**/*.hp - name: Archive benchmark logs uses: actions/upload-artifact@v3 with: name: bench-logs-${{ runner.os }}-${{ matrix.ghc }} - path: | - ghcide/bench-results/**/*.log - ghcide/bench-results/**/*.eventlog - ghcide/bench-results/**/*.hp + path: benchmark-logs.tar.gz bench_post_job: if: always() From 9b950a804aa95bfa4a1f3addb4ecc1fd42317fb6 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sun, 14 Aug 2022 19:49:35 +0200 Subject: [PATCH 7/8] format --- ghcide/bench/lib/Experiments.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ghcide/bench/lib/Experiments.hs b/ghcide/bench/lib/Experiments.hs index 3af4f5f416..081df51984 100644 --- a/ghcide/bench/lib/Experiments.hs +++ b/ghcide/bench/lib/Experiments.hs @@ -24,8 +24,8 @@ module Experiments ) where import Control.Applicative.Combinators (skipManyTill) import Control.Exception.Safe (IOException, handleAny, try) -import Control.Monad.Extra - ( forM_, void, unless, forM, (&&^), allM, whenJust ) +import Control.Monad.Extra (allM, forM, forM_, unless, + void, whenJust, (&&^)) import Control.Monad.Fail (MonadFail) import Control.Monad.IO.Class import Data.Aeson (Value (Null), toJSON) @@ -77,7 +77,7 @@ data DocumentPositions = DocumentPositions { allWithIdentifierPos :: MonadFail m => (DocumentPositions -> m Bool) -> [DocumentPositions] -> m Bool allWithIdentifierPos f docs = case applicableDocs of -- fail if there are no documents to benchmark - [] -> fail "None of the example modules have identifier positions" + [] -> fail "None of the example modules have identifier positions" docs' -> allM f docs' where applicableDocs = filter (isJust . identifierP) docs From c3909740f414507fb5b64ba6ce4bb3db78328e8c Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Mon, 15 Aug 2022 11:07:00 +0200 Subject: [PATCH 8/8] fixup --- .github/workflows/bench.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 78dc28b56b..2945ac2812 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -141,12 +141,7 @@ jobs: column -s, -t < ghcide/bench-results/unprofiled/${{ matrix.example }}/results.csv | tee ghcide/bench-results/unprofiled/${{ matrix.example }}/results.txt - name: tar benchmarking artifacts - run: | - tar -czf benchmark-artifacts.tar.gz \ - ghcide/bench-results/results.* \ - ghcide/bench-results/**/*.csv \ - ghcide/bench-results/**/*.svg \ - ghcide/bench-results/**/*.eventlog.html + run: find ghcide/bench-results -name "*.csv" -or -name "*.svg" -or -name "*.html" | xargs tar -czf benchmark-artifacts.tar.gz - name: Archive benchmarking artifacts uses: actions/upload-artifact@v3 @@ -155,11 +150,7 @@ jobs: path: benchmark-artifacts.tar.gz - name: tar benchmarking logs - run: | - tar -czf benchmark-logs.tar.gz \ - ghcide/bench-results/**/*.log \ - ghcide/bench-results/**/*.eventlog \ - ghcide/bench-results/**/*.hp + run: find ghcide/bench-results -name "*.log" -or -name "*.eventlog" -or -name "*.hp" | xargs tar -czf benchmark-logs.tar.gz - name: Archive benchmark logs uses: actions/upload-artifact@v3