on master help sign in
Update cabal file for text-benchmarks
commitdcbb74d335d0dbb3592e4c2dbb59ba93754a4af6 authorHerbert Valerio Riedel <hvr@gnu.org> dateWed 27 Dec 2017, 13:11 (9 years ago) parent772254f
4 files changed+93−13
benchmarks/.gitignore+4−1 benchmarks/cabal.project+2 benchmarks/text-benchmarks.cabal+81−8 tests-and-benchmarks.markdown+6−4
benchmarks/.gitignore+4−1
@@ -1 +1,4 @@
1−dist
1+/dist/
2+/dist-newstyle/
3+/.ghc.environment.*
4+/cabal.project.local
benchmarks/cabal.projectnew file+2
@@ -0,0 +1,2 @@
1+-- NB: we use a separate project
2+packages: .
benchmarks/text-benchmarks.cabal+81−8
@@ -12,8 +12,7 @@ author: Jasper Van der Jeugt <jaspervdj@gmail.com>,
1212maintainer: jaspervdj@gmail.com
1313category: Text
1414build-type: Simple
15−
16−cabal-version: >=1.2
15+cabal-version: >=1.8
1716
1817flag bytestring-builder
1918 description: Depend on the bytestring-builder package for backwards compatibility.
@@ -26,16 +25,12 @@ flag llvm
2625 manual: True
2726
2827executable text-benchmarks
29− hs-source-dirs: haskell ..
30− c-sources: ../cbits/cbits.c
31− cbits/time_iconv.c
32− include-dirs: ../include
33− main-is: Benchmarks.hs
3428 ghc-options: -Wall -O2 -rtsopts
3529 if flag(llvm)
3630 ghc-options: -fllvm
3731 cpp-options: -DHAVE_DEEPSEQ -DINTEGER_GMP
38− build-depends: base == 4.*,
32+ build-depends: array,
33+ base == 4.*,
3934 binary,
4035 blaze-builder,
4136 bytestring-lexing >= 0.5.0,
@@ -57,9 +52,87 @@ executable text-benchmarks
5752 else
5853 build-depends: bytestring >= 0.10.4
5954
55+ -- modules for benchmark proper
56+ c-sources: cbits/time_iconv.c
57+ hs-source-dirs: haskell
58+ main-is: Benchmarks.hs
59+ other-modules:
60+ Benchmarks.Builder
61+ Benchmarks.Concat
62+ Benchmarks.DecodeUtf8
63+ Benchmarks.EncodeUtf8
64+ Benchmarks.Equality
65+ Benchmarks.FileRead
66+ Benchmarks.FoldLines
67+ Benchmarks.Mul
68+ Benchmarks.Programs.BigTable
69+ Benchmarks.Programs.Cut
70+ Benchmarks.Programs.Fold
71+ Benchmarks.Programs.Sort
72+ Benchmarks.Programs.StripTags
73+ Benchmarks.Programs.Throughput
74+ Benchmarks.Pure
75+ Benchmarks.ReadNumbers
76+ Benchmarks.Replace
77+ Benchmarks.Search
78+ Benchmarks.Stream
79+ Benchmarks.WordFrequencies
80+
81+ -- Source code for IUT (implementation under test)
82+ -- "borrowed" from parent folder
83+ include-dirs: ../include
84+ c-sources: ../cbits/cbits.c
85+ hs-source-dirs: ..
86+ other-modules:
87+ Data.Text
88+ Data.Text.Array
89+ Data.Text.Encoding
90+ Data.Text.Encoding.Error
91+ Data.Text.Foreign
92+ Data.Text.IO
93+ Data.Text.Internal
94+ Data.Text.Internal.Builder
95+ Data.Text.Internal.Builder.Functions
96+ Data.Text.Internal.Builder.Int.Digits
97+ Data.Text.Internal.Builder.RealFloat.Functions
98+ Data.Text.Internal.Encoding.Fusion
99+ Data.Text.Internal.Encoding.Fusion.Common
100+ Data.Text.Internal.Encoding.Utf16
101+ Data.Text.Internal.Encoding.Utf32
102+ Data.Text.Internal.Encoding.Utf8
103+ Data.Text.Internal.Functions
104+ Data.Text.Internal.Fusion
105+ Data.Text.Internal.Fusion.CaseMapping
106+ Data.Text.Internal.Fusion.Common
107+ Data.Text.Internal.Fusion.Size
108+ Data.Text.Internal.Fusion.Types
109+ Data.Text.Internal.IO
110+ Data.Text.Internal.Lazy
111+ Data.Text.Internal.Lazy.Encoding.Fusion
112+ Data.Text.Internal.Lazy.Fusion
113+ Data.Text.Internal.Lazy.Search
114+ Data.Text.Internal.Private
115+ Data.Text.Internal.Read
116+ Data.Text.Internal.Search
117+ Data.Text.Internal.Unsafe
118+ Data.Text.Internal.Unsafe.Char
119+ Data.Text.Internal.Unsafe.Shift
120+ Data.Text.Lazy
121+ Data.Text.Lazy.Builder
122+ Data.Text.Lazy.Builder.Int
123+ Data.Text.Lazy.Builder.RealFloat
124+ Data.Text.Lazy.Encoding
125+ Data.Text.Lazy.IO
126+ Data.Text.Lazy.Internal
127+ Data.Text.Lazy.Read
128+ Data.Text.Read
129+ Data.Text.Unsafe
130+ Data.Text.Show
131+
60132executable text-multilang
61133 hs-source-dirs: haskell
62134 main-is: Multilang.hs
135+ other-modules: Timer
63136 ghc-options: -Wall -O2
64137 build-depends: base == 4.*,
65138 bytestring,
tests-and-benchmarks.markdown+6−4
@@ -54,10 +54,12 @@ To compile the benchmarks, navigate to the `benchmarks` subdirectory and run
5454
5555 ./dist/build/text-benchmarks/text-benchmarks
5656
57−However, since there's quite a lot of benchmarks, you usually don't want to
58−run them all. Instead, use the `-l` flag to get a list of benchmarks:
57+Or if you have a recent enough `cabal`, you can build and run the
58+benchmarks via
5959
60− ./dist/build/text-benchmarks/text-benchmarks
60+ cabal new-run exe:text-benchmarks -- --help
6161
62−And run the ones you want to inspect. If you want to configure the benchmarks
62+However, since there's quite a lot of benchmarks, you usually don't want to
63+run them all. Instead, use the `-l` flag to get a list of benchmarks
64+and run the ones you want to inspect. If you want to configure the benchmarks
6365further, the exact parameters can be changed in `Benchmarks.hs`.