Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,24 +140,23 @@ 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: 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
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: 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
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()
Expand Down
8 changes: 4 additions & 4 deletions ghcide/bench/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ examples:
package: lsp-types
version: 1.5.0.0
modules:
- src/Language/LSP/VFS.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/VFS.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
Expand Down
13 changes: 10 additions & 3 deletions ghcide/bench/lib/Experiments.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ module Experiments
) where
import Control.Applicative.Combinators (skipManyTill)
import Control.Exception.Safe (IOException, handleAny, try)
import Control.Monad.Extra
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)
import Data.Either (fromRight)
Expand Down Expand Up @@ -72,8 +74,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 =
Expand Down