Commit Graph

80 Commits

Author SHA1 Message Date
Harendra Kumar
f09e741e04 Add benchmarks for maxRate, maxThreads and maxBuffer 2018-08-12 18:20:03 +05:30
Harendra Kumar
c39a442ddf Add benchmarks and tests for new operations
Also fix the signature of foldl1'
Add notes about state passing
2018-08-09 00:43:48 +05:30
Harendra Kumar
6ab3ce0655 disable map-and-filter composition benchmarks for GHC-8.2
GHC-8.2 crashes with this code with out-of-memory
2018-07-14 13:10:09 +05:30
Harendra Kumar
ec0868181c update base stream benchmarks 2018-07-14 13:10:09 +05:30
Harendra Kumar
55f9cfa371 fix foldxM strictness
The main change is a single line change in StreamK.hs in foldxM routine.

Major changes in this commit are due to:
1) Added strictness tests for all foldl and scanl rotuines
2) refactoring to enable independent benchmarking for StreamK, to measure the
  impact of the change.
2018-07-13 19:00:38 +05:30
Harendra Kumar
9fe6dc1726 use direct style zipWith and zipWithM 2018-06-27 09:10:39 +05:30
Harendra Kumar
6530e7634f push uncons/null/head/tail to StreamK
and implement direct versions of these as well.
2018-06-27 05:20:14 +05:30
Harendra Kumar
9b78a64f80 implement elem/notElem/all/any for StreamD 2018-06-27 01:04:26 +05:30
Harendra Kumar
c7d2f9e0a3 Add flag to switch stream backend to streamk 2018-06-26 09:44:06 +05:30
Harendra Kumar
beba8f7919 Use direct style filtering functions
Also, organized a lot of code, by reordering in a more logical order and made
it consistent across multiple streams types.
2018-06-26 06:00:47 +05:30
Harendra Kumar
d0a07bb70e update benchmarks for streamD/K 2018-06-25 05:45:45 +05:30
Harendra Kumar
5ace3582a8 use foldl' for length, sum, product 2018-06-25 03:51:02 +05:30
Harendra Kumar
de5c0ca22e use direct style scan, push mapMaybe from prelude to StreamK 2018-06-25 03:15:22 +05:30
Harendra Kumar
3ae953064d use folds and map from direct style stream 2018-06-24 22:43:30 +05:30
Harendra Kumar
7a526f22b9 use direct style streams for linear composition
For some stream generation APIs.
Also added, fromList/fromListM APIs.
2018-06-24 06:19:41 +05:30
Harendra Kumar
9bb5ac1ea2 Add dev benchmarks for base cont and direct streams 2018-06-23 20:57:24 +05:30
Harendra Kumar
9c85811905 rename "once" to "yieldM"
and some other related refactoring changes.
2018-06-23 06:50:59 +05:30
Harendra Kumar
42e5c6bd93 INLINE the main benchmark function
makes a big difference especially when the times are small.
2018-06-20 04:49:00 +05:30
Harendra Kumar
b77e76fd53 Add/rearrange INLINE pragmas on benchmarks 2018-06-18 02:56:52 +05:30
Harendra Kumar
b9e5e424a7 remove the append benchmark
it is already covered by the generation benchmarks
2018-06-13 17:46:54 +05:30
Harendra Kumar
aa4c8707b5 add more benchmarks, update benchmarks 2018-06-09 21:11:15 +05:30
Harendra Kumar
1d13085fb2 Exit and restart workers instead of making them wait 2018-06-03 00:28:14 +05:30
Harendra Kumar
c9fdf949ee Add more diagnostics to study the adaptation 2018-06-03 00:28:14 +05:30
Harendra Kumar
12bca7832a Add benchmarks for adaptive concurrency 2018-06-03 00:28:14 +05:30
Harendra Kumar
decdf72e3a use lower number of elements in benchmark stream
To enable parallel benchmarks
2018-06-03 00:28:14 +05:30
Harendra Kumar
2f706b9bfb add concurrent stream generation benchmarks 2018-05-28 11:35:33 +05:30
Harendra Kumar
669295965a Add some INLINABLE pragams 2018-05-27 10:33:21 +05:30
Harendra Kumar
9cb2ac0bb7 Add concurrent generation and transformation capabilities
- monadic stream generation functions are now concurrent
- monadic stream transformation (mapM, sequence) functions are now concurrent
- fixed a race which caused blockedindefinitely on MVar in rare cases
2018-05-24 16:48:48 +05:30
Harendra Kumar
3b6427818f Add fromFoldableM
Also,

- INLINE consM and once
- add benchmarking for various ways of sourcing (unfoldr(M), fromFoldable(M),
  foldMapWith serial)
2018-05-21 17:54:19 +05:30
Harendra Kumar
9da3fccd20 Add concurrent lookahead stream type "Ahead" 2018-05-17 11:22:29 +05:30
Harendra Kumar
2fb74c756f Fix benchmark charting 2018-05-13 11:58:09 +05:30
Harendra Kumar
c8b32f2a53 Fix naming changes in benchmarks 2018-05-13 10:27:49 +05:30
Harendra Kumar
091f4b69fe Add the strictly parallel stream type ParallelT 2018-05-08 07:49:43 +05:30
Harendra Kumar
74dd5a01b6 rename streams with a consistent and intuitive scheme
The trigger for this change is that parallel stream is not really parallel it is
a concurrent lookahead like just in a different traversal style. So we make
parallel and coparallel as parAhead and coparAhead instead and later introduce
a new style for parallel which would be strictly parallel with one thread for
each stream started right away rather than speculatively.
2018-05-07 19:17:02 +05:30
Harendra Kumar
cf1388b330 Add append benchmark to linear benchmarks 2018-05-06 05:13:10 +05:30
Harendra Kumar
4b5abb0915 fix benchmark comparison graphs
Generate graphs for both linear and nested benchmark ops
2018-04-25 14:21:02 +05:30
Harendra Kumar
a526207acd rename the default stream type to StreamT
This was earlier changed from StreamT to SerialT. However we have made this the
default type now and it makes more sense to call it StreamT now. A bigger
motivation for the change is that StreamT immediately conveys that it is a
stream which is helpful and intuitive for new learners. Also we have a plan to
have a specialized type called "Stream a = StreamT IO a", so the name StreamT
is in line with that common default type "Stream a". Calling that type as
"Serial a" does not sound as intuitive as calling it "Stream a".
2018-04-25 11:31:12 +05:30
Harendra Kumar
ac39277da8 Rename benchmark modules 2018-04-25 11:28:47 +05:30
Harendra Kumar
e223cfade7 Remove old, now redundant, benchmarks 2018-04-25 11:28:47 +05:30
Harendra Kumar
d2c4df460f Add microbenchmarks for list-transformer ops 2018-04-25 11:28:47 +05:30
Harendra Kumar
30a6e32fee Fix Monoid and other instances
Monoid instances should not be derived from underlying type where we want them
to be type specific. Added tests to make sure they are correct.

Other typeclass instances that are dependent on type specific behavior should
also be independently defined rather than derived.

Removed Alternative instances as they are not correct yet.

Removed redundancy by using CPP macros to define instances of different types.
2018-04-22 15:59:09 +05:30
Harendra Kumar
acd550c731 rename InterleavedT=>CoserialT, AParallelT=>CoparallelT 2018-04-18 17:32:25 +05:30
Harendra Kumar
3f638d9b6d rename interleave=>coserial, aparallel=>coparallel 2018-04-18 16:55:16 +05:30
Harendra Kumar
7e4fde1780 Fix benchmarks 2018-04-18 15:26:15 +05:30
Harendra Kumar
3d920ef3f8 rename AsyncT to AParallelT
Also rename asyncly to aparallely and runAsyncT to runAParallelT

The name Async is confusing and does not convey the right meaning. The 'A' in
AParallelT stands for 'Adaptive' and 'Parallel' indicates that this is a
variant of Parallel.

Another choice for the name was 'MParallelT' where 'M' stands for 'maybe', it
is maybe parallel since it may or may not start parallel threads depending on
demand but Adaptive fits better as it adapts to the demand.
2018-04-17 18:03:27 +05:30
Harendra Kumar
583a48c490 use new names for deprecated functions 2018-04-17 10:07:52 +05:30
Harendra Kumar
6e32a15788 rename each to fromFoldable
fixes #14
2018-04-15 21:10:16 +05:30
Harendra Kumar
a34b1f31ad rename fold functions to make them consistent with base/Foldable 2018-04-15 19:39:43 +05:30
Harendra Kumar
408fef1c73 rename Streaming to IsStream and runStreaming to runStream
fixes #52
2018-04-15 15:08:11 +05:30
Harendra Kumar
5c5b2b3ed8 rename all references to StreamT to SerialT 2018-04-15 15:05:59 +05:30