Commit Graph

31 Commits

Author SHA1 Message Date
Harendra Kumar
55d49bd50c Optimize Functor/Applicative/Monad etc for serial
Some of the benchmarks were order of magnitude off due to missing INLINE for
type class operations. Now, all of them are in reasonable limits. Benchmarks
affected for serial streams:

* Functor, Applicative, Monad, transformers

We need to do a similar exercise for other types of streams and for
folds/parsers as well.
2020-06-23 13:41:41 +05:30
Harendra Kumar
1a331cb402 Add more benchmarks for applicative/monad
Separate the applicative and monad benchmark groups
Complete benchmarks for all type class operations
2020-06-21 15:15:55 +05:30
Harendra Kumar
c0bd11de4b Elaborate concatMap, async benchmarks
* Add 3 interesting cases for each concatMap case
* For mapM, map concurrently on a serial stream so that we measure the
  concurrency overhead of mapM only and not both concurrent generation + mapM
* For Async streams add some benchmarks involving the `async` combinator.
* Add a benchmark for `foldrS`
2020-06-21 11:28:59 +05:30
Harendra Kumar
354f337c80 Fix performance of monad-outer-product benchmarks 2020-06-08 14:37:52 +05:30
Harendra Kumar
129ebaf82c Refactor Prelude benchmarks
* Now benchmark modules correspond to source modules. The Prelude module in
  source corresponds to several modules one for each stream type.

* Benchmarks in the same order/groupings as they appear in source

* All benchmarks now have division according to space complexity

* Refactoring reduces a lot of code duplication especially the stream
  generation and elimination functions.

* The RTS options are now completely set in the shell script to run the
  benchmarks.

* RTS options can be set on a per benchmark basis. RTS options work correctly
  now.

* The set of streaming/infinite stream benchmarks is now complete and we can
  run all such benchmarks coneveniently.

* Benchmark "quick"/"speed" options can now be specified on a per benchmark
  basis. Longer benchmarks can have fewer iterations/quick run time.

* Benchmarks are grouped in several groups which can be run on a per group
  basis. Comparison groups are also defined for convenient comparisons of
  different modules (e.g. arrays or streamD/K).

* The benchmark namespaces are grouped in a consistent manner. Benchmark
  executables have a consistent naming based on module names.
2020-06-07 01:48:05 +05:30
Harendra Kumar
1c57096c3c Split "base" benchmark into per module benchmarks
Also, use module name prefix on the benchmarks.
2020-06-07 01:17:43 +05:30
adithyaov
ae7a0250cd Split lib/b/Prelude into Generation, Elimination and Transformation 2020-06-07 01:17:42 +05:30
adithyaov
cf8ec5cc91 Rename o_1_space_parallel* to o_n_space_parallel* 2020-06-07 01:09:26 +05:30
Harendra Kumar
b90107f15b Fix build for older versions of GHC 2020-06-03 23:30:04 +05:30
Harendra Kumar
07efcbd671 Add benchmark for classifySessionsOf 2020-05-28 19:16:01 +05:30
Harendra Kumar
602539f613 Add/change some time/interspersing combinators
Add: intersperseSuffix_, delay, timeIndexed
Change the APIs: times, absTimes, relTimes, timestamped

The new APIs have a default clock granularity of 10 ms.
2020-05-28 16:26:59 +05:30
Harendra Kumar
7f9d4a4210 Add some time related combinators
add: times, relTimes, timestamped
unimplemented skeletons: durations, ticks, timeout

Changes to the original currentTime combinator: remove delay from the first
event, cap the granularity to 1 ms to guarantee reasonable cpu usage.
2020-05-27 12:21:54 +05:30
adithyaov
633e88f8c5 Move unfold benchmarks out of prelude. Make a seperate exec. 2020-04-08 19:38:33 +05:30
adithyaov
18949ef414 Move b/NestedOps.hs and b/NestedUnfoldOps.hs to b/Streamly/Benchmark 2020-04-08 19:38:33 +05:30
adithyaov
9797d7615d Make a sandalone fold executable. 2020-03-29 18:40:51 +05:30
adithyaov
18c903f5c4 Seperate folds from Prelude in benchmarks. 2020-03-18 11:31:01 +05:30
adithyaov
f2011dfcd7 Keep signature/pragma and definitions for each benchmark together 2020-03-02 16:59:03 +05:30
Harendra Kumar
e76546fbb1 format some parts of the benchmarking code 2020-02-28 19:58:06 +05:30
adithyaov
1f502b1c1d Prepend unused functions with _ to suppress -Wunused-top-binds 2020-02-28 19:58:06 +05:30
adithyaov
e7c5fd43fe Export all groups in lib/Streamly/Benchmark/Prelude.hs 2020-02-28 19:58:06 +05:30
adithyaov
879d5d5aa5 Merge LinearRate.hs into Prelude.hs
* LinearRate.hs -> lib/Streamly/Benchmark/Prelude.hs
* Modify LinearRate.hs accordingly
2020-02-28 19:58:06 +05:30
adithyaov
7f5c73f645 Merge Parallel.hs into Prelude.hs
* Parallel.hs -> lib/Streamly/Benchmark/Prelude.hs
* Modify Parallel.hs accordingly
2020-02-28 19:58:06 +05:30
adithyaov
fa8a2cf867 Merge LinearAsync.hs into Prelude.hs
* LinearAsync.hs -> lib/Streamly/Benchmark/Prelude.hs
* Modify LinearAsync.hs accordingly
2020-02-28 19:58:06 +05:30
adithyaov
b62c02f44a Merge O_n_Stack.hs into Prelude.hs
* Benchmark/Prelude/Serial/O_n_Stack ->
  lib/Streamly/Benchmark/Prelude.hs
* Modify O_n_Stack.hs accordingly
2020-02-28 19:58:06 +05:30
adithyaov
69a81af68d Merge O_n_Heap.hs into Prelude.hs
* Benchmark/Prelude/Serial/O_n_Heap ->
  lib/Streamly/Benchmark/Prelude.hs
* Modify O_n_Heap.hs accordingly
2020-02-28 19:58:06 +05:30
adithyaov
8544b1f1e7 Merge O_n_Space.hs into Prelude.hs
* Benchmark/Prelude/Serial/O_n_Space ->
  lib/Streamly/Benchmark/Prelude.hs
* Modify O_n_Space.hs accordingly
2020-02-28 19:58:06 +05:30
adithyaov
4d59cb3afe Merge lib/B/Groups.hs into lib/B/Prelude.hs
* Remove lib/B/Group.hs
* The idea: Have all the groups in Prelude and
  export only the groups, that way, all the functions
  aren't compiled multiple times (without and with
  inlining).
2020-02-28 19:58:06 +05:30
adithyaov
2dacf99488 Move and split benchmarks from O_1_Space.hs to Groups.hs
* Streamly/Benchmark/Prelude/O_1_Space.hs ->
lib/Streamly/Benchmark/Groups.hs

* Modify O_1_Space.hs accordingly
2020-02-28 19:58:06 +05:30
Harendra Kumar
678a404311 Add some inspection tests for SPEC constructor 2020-02-22 14:12:49 +05:30
Harendra Kumar
166bd93267 refactor "base" stream benchmarks
push the benchmark definitions from the top level "BaseStreams.hs" file to the
individual stream modules to improve modularity.
2020-02-21 16:32:46 +05:30
Harendra Kumar
0b00efe4f6 Reorganize benchmark modules
* move common modules to lib directory. This is required because otherwise
  cabal/ghc would try to use them directly and emit warnings about
  missing-modules.

* move the prelude benchmark executables to Streamly/Benchmark/Prelude
  to be consistent with the organization of other modules.
2020-02-21 16:32:46 +05:30