Skip to content
This repository was archived by the owner on Jan 2, 2021. It is now read-only.

Commit 080a22f

Browse files
committed
Turn benchHist into a benchmark and ghcide-bench into an exe
This works out nicely because: 1. benchHist already runs ghcide-bench, 2. benchHist has additional deps, but ghcide-bench does not 3. This is the only way I've found to get ghcide-bench in the PATH for benchHist
1 parent 40eb4aa commit 080a22f

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

bench/exe/Main.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
- Analyisis of performance over the commit history of the project
2424
2525
How to run:
26-
1. `cabal bench`
27-
2. `cabal exec cabal run ghcide-bench -- -- ghcide-bench-options`
26+
1. `cabal exec cabal run ghcide-bench -- -- ghcide-bench-options`
27+
1. `stack build ghcide:ghcide-bench && stack exec ghcide-bench -- -- ghcide-bench-options`
2828
2929
Note that the package database influences the response times of certain actions,
3030
e.g. code actions, and therefore the two methods above do not necessarily

bench/hist/Main.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
3030
To execute the script:
3131
32-
> stack build --flag ghcide:bench-hist ghcide:exe:benchHist && stack exec benchHist all
32+
> stack bench
3333
3434
To build a specific analysis, enumerate the desired file artifacts
3535
36-
> stack exec benchHist bench-hist/HEAD/results.csv bench-hist/HEAD/edit.diff.svg
36+
> stack bench --ba "bench-hist/HEAD/results.csv bench-hist/HEAD/edit.diff.svg"
3737
3838
-}
3939
{-# LANGUAGE DeriveAnyClass #-}

ghcide.cabal

+6-14
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ flag ghc-lib
3232
default: False
3333
manual: True
3434

35-
flag bench-hist
36-
description: build the benchHist benchmark runner
37-
default: False
38-
manual: False
39-
4035
library
4136
default-language: Haskell2010
4237
build-depends:
@@ -178,14 +173,13 @@ executable ghcide-test-preprocessor
178173
build-depends:
179174
base == 4.*
180175

181-
executable benchHist
176+
benchmark benchHist
177+
type: exitcode-stdio-1.0
182178
default-language: Haskell2010
183-
if flag(bench-hist)
184-
buildable: True
185-
else
186-
buildable: False
187179
ghc-options: -Wall -Wno-name-shadowing -threaded
188180
main-is: bench/hist/Main.hs
181+
build-tool-depends:
182+
ghcide:ghcide
189183
default-extensions:
190184
BangPatterns
191185
DeriveFunctor
@@ -350,12 +344,10 @@ test-suite ghcide-tests
350344
TypeApplications
351345
ViewPatterns
352346

353-
benchmark ghcide-bench
354-
type: exitcode-stdio-1.0
347+
executable ghcide-bench
355348
default-language: Haskell2010
356349
build-tool-depends:
357-
ghcide:ghcide,
358-
ghcide:ghcide-test-preprocessor
350+
ghcide:ghcide
359351
build-depends:
360352
aeson,
361353
base,

0 commit comments

Comments
 (0)