Commit Graph

359 Commits

Author SHA1 Message Date
Harendra Kumar
f0398ee8b6 Add benchmarking for fromParserK 2020-07-17 03:46:04 +05:30
Harendra Kumar
37f325e4b2 Add some more benchmarks for ParserK 2020-07-17 03:46:04 +05:30
Harendra Kumar
81339c8f8b Fix comments 2020-07-13 23:58:02 +05:30
Harendra Kumar
09f2fa7cb4 Add the ability to select fields to report 2020-07-09 17:40:27 +05:30
Harendra Kumar
89b9e233ba Fix inspection tests 2020-07-09 17:40:27 +05:30
Harendra Kumar
bc6b4eed32 Reduce compile time mem util in Handle benchmarks
* Split into two modules
* Remove unnecessary INLINE pragmas
2020-07-09 17:40:27 +05:30
Harendra Kumar
0d586750a7 Add INLINE phase annotations on some functions 2020-07-09 16:10:24 +05:30
Harendra Kumar
53504dba3c Use smaller input files for longer benchmarks 2020-07-09 16:10:01 +05:30
Harendra Kumar
3d033ae915 Reorganize, move the FileIO benchmarks
Now they are in FileSystem.Handle module corresponding to the source module
with the same name. Also, now we have them arranged based on space complexity
so that we can apply RTS memory restrictions when running.

Also, now longer benchmarks use a shorter file.
2020-07-08 03:10:09 +05:30
Harendra Kumar
ea79e0f9b7 Add "allocated" and "bytesCopied" fields
"allocated" is much more stable for regression comparisons as it stays the same
whereas "time" varies based on various factors like cpu frequency, other things
running on the computer, context switches etc.

bytesCopied is a measure of long lived data being retained across GCs, which is
also a good measure of performance.
2020-07-07 16:23:06 +05:30
pranaysashank
202f674462 Change the signature of foldlM' to use a monadic seed.
- Also change usages of foldlM' in tests and benchmarks.
2020-07-07 14:17:44 +05:30
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
b4cef11d19 Add iterative benchmarks for Functor/transformers
* Also factor out the existing iteration utilities and use the same everywhere
2020-06-23 13:01:25 +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
1cccb00101 Use foldrSShared instead of foldrS for Async
Because of not sharing the SVar foldrS performs poorly for Async streams and
has quadratic complexity.
2020-06-21 11:28:59 +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
f9a7d24230 Fix perf regression in zip/zipM benchmarks 2020-06-08 18:52:06 +05:30
Harendra Kumar
354f337c80 Fix performance of monad-outer-product benchmarks 2020-06-08 14:37:52 +05:30
Harendra Kumar
294aa21417 Disable some broken benchmarks 2020-06-07 18:34:40 +05:30
Harendra Kumar
75903a101a Update with new changes in benchmaring script 2020-06-07 10:28:15 +05:30
Harendra Kumar
dc68afd167 Fix inspection testing 2020-06-07 10:27:58 +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
ed799d6b51 Fix unfold benchmark name, namespace, RTS options 2020-06-07 01:26:34 +05:30
Harendra Kumar
c2def514f9 Fix parser benchmark namespace and RTS options
Also, rename the benchmark modules to reflect source module hierarchy.
2020-06-07 01:26:34 +05:30
Harendra Kumar
0b83f5d445 Fix benchmark name space for fold benchmarks
Use Data.Fold/o-1-space/...
2020-06-07 01:17:43 +05:30
Harendra Kumar
c2fa79613e Generalize group/comparative benchmarking 2020-06-07 01:17:43 +05:30
Harendra Kumar
f72d007c51 Rename array benchmarks and prefixes by module names 2020-06-07 01:17:43 +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
adithyaov
e7df8acee3 Merge all the base* executables 2020-06-07 01:09:26 +05:30
adithyaov
0d66526074 Add a standard behaviour to Chart.hs 2020-06-07 01:09:26 +05:30
adithyaov
9abd8b84b6 Merge all the Serial/* benchmarks into Serial.hs 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
01fa925af3 rename mconcatTo to sconcat 2020-05-31 01:46:01 +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
Harendra Kumar
aa25b34db0 Add benchmarks for *>, <*, split_, sequence_ 2020-05-11 21:25:24 +05:30
Harendra Kumar
2c9feb48ef Add YieldB (yield and backtrack) constructor
This fixes an issue in many/some/manyTill combinators.
2020-05-11 21:25:24 +05:30
Harendra Kumar
633c55eb31 rename splitParse/parseMany, concatParse/parseIterate 2020-05-11 21:18:09 +05:30
Harendra Kumar
684d2786eb Add concatParse to chain parsers on a stream
Add mconcatTo, update fold docs
Add fold docs/snippets using Monoids.
Add benchmark for sum using foldMap
Add concatParse benchmark
Add splitParseTill, update docs
2020-05-11 20:54:22 +05:30
Harendra Kumar
899cab5cd4 Make License Identifier SPDX compliant 2020-04-24 03:57:46 +05:30
Harendra Kumar
d7866f732d INLINE some/many implement *>/<*
Benchmarks that improved:

ParserK(cpuTime)
Benchmark                   default(0)(μs) default(1) - default(0)(%)
--------------------------- -------------- --------------------------
o-n-heap/parserK/sequenceA_       11183.17                     -32.75
o-n-heap/parserK/manyAlt          41514.00                     -40.82
o-n-heap/parserK/someAlt          68026.25                     -61.77
2020-04-24 02:59:40 +05:30
Harendra Kumar
dde9041833 Use parserK by default and rewrite to ParserD 2020-04-24 00:30:01 +05:30
Harendra Kumar
a03e2872a6 rename Parser module to ParserD
The top level module "Parser" will be using both ParserK and ParserD.
2020-04-24 00:30:01 +05:30
Harendra Kumar
12fef4390f Add a CPS style parser implementation
CPS performs much better for parsing operations like "sequence" and
"choice" on large containers. Given that applicative "sequence" does
not scale, I guess the Monad instance as well won't scale for direct
implementation.
2020-04-24 00:30:01 +05:30
Pranay Sashank
451239bf9c Bump template-haskell upper bound < 2.17.
- GHC 8.10.1 ships with template-haskell 2.16.
2020-04-20 17:29:07 +05:30
Harendra Kumar
f51bbb25bd Rename some parsers and add some TBD and comments 2020-04-16 23:11:49 +05:30
Harendra Kumar
c8bbb0a1c8 Add lookAhead 2020-04-16 23:11:22 +05:30