on master help sign in
Update cabal file for text-benchmarks
dcbb74dHerbert Valerio Riedel
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>,
12maintainer: jaspervdj@gmail.com
12maintainer: jaspervdj@gmail.com
13category: Text
13category: Text
14build-type: Simple
14build-type: Simple
15−
16−cabal-version: >=1.2
15+cabal-version: >=1.8
17
16
18flag bytestring-builder
17flag bytestring-builder
19 description: Depend on the bytestring-builder package for backwards compatibility.
18 description: Depend on the bytestring-builder package for backwards compatibility.
@@ -26,16 +25,12 @@ flag llvm
26 manual: True
25 manual: True
27
26
28executable text-benchmarks
27executable 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
34 ghc-options: -Wall -O2 -rtsopts
28 ghc-options: -Wall -O2 -rtsopts
35 if flag(llvm)
29 if flag(llvm)
36 ghc-options: -fllvm
30 ghc-options: -fllvm
37 cpp-options: -DHAVE_DEEPSEQ -DINTEGER_GMP
31 cpp-options: -DHAVE_DEEPSEQ -DINTEGER_GMP
38− build-depends: base == 4.*,
32+ build-depends: array,
33+ base == 4.*,
39 binary,
34 binary,
40 blaze-builder,
35 blaze-builder,
41 bytestring-lexing >= 0.5.0,
36 bytestring-lexing >= 0.5.0,
@@ -57,9 +52,87 @@ executable text-benchmarks
57 else
52 else
58 build-depends: bytestring >= 0.10.4
53 build-depends: bytestring >= 0.10.4
59
54
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+
60executable text-multilang
132executable text-multilang
61 hs-source-dirs: haskell
133 hs-source-dirs: haskell
62 main-is: Multilang.hs
134 main-is: Multilang.hs
135+ other-modules: Timer
63 ghc-options: -Wall -O2
136 ghc-options: -Wall -O2
64 build-depends: base == 4.*,
137 build-depends: base == 4.*,
65 bytestring,
138 bytestring,
tests-and-benchmarks.markdown+6−4
@@ -54,10 +54,12 @@ To compile the benchmarks, navigate to the `benchmarks` subdirectory and run
54
54
55 ./dist/build/text-benchmarks/text-benchmarks
55 ./dist/build/text-benchmarks/text-benchmarks
56
56
57−However, since there's quite a lot of benchmarks, you usually don't want to
57+Or if you have a recent enough `cabal`, you can build and run the
58−run them all. Instead, use the `-l` flag to get a list of benchmarks:
58+benchmarks via
59
59
60− ./dist/build/text-benchmarks/text-benchmarks
60+ cabal new-run exe:text-benchmarks -- --help
61
61
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
62−And run the ones you want to inspect. If you want to configure the benchmarks
64+and run the ones you want to inspect. If you want to configure the benchmarks
63further, the exact parameters can be changed in `Benchmarks.hs`.
65further, the exact parameters can be changed in `Benchmarks.hs`.