Commit Graph

381 Commits

Author SHA1 Message Date
adithyaov
fc25c42ab1 Add micro benchmarks for convering exposed APIs in Fold
Benchamrks added:
- drainBy
- foldMapM
- lookup
- sequence
- tee
- distribute
- partition
- unzip
2020-10-18 00:06:52 +05:30
adithyaov
8d6b695ddb Replace value with size and n with start in bench:Data.Unfold 2020-10-17 21:32:23 +05:30
adithyaov
5004f12409 Add docs & change the signature of replicateM and repeatM
This commit also include some other minor changes
2020-10-17 21:32:23 +05:30
adithyaov
07d0609dee Add additional Unfold benchmarks 2020-10-17 21:32:23 +05:30
Harendra Kumar
a3c3db465f Add prime sieves to benchmarks
Prime sieves are good benchmarks for scan and monad composition.
2020-10-16 21:50:51 +05:30
pranaysashank
25f76d5524 Add new encoding/decoding routines.
- Add encodeUtf8_, encodeLatin1_, encodeUtf8', encodeLatin1',
  decodeUtf8_, decodeUtf8', decodeUtf8Arrays_, decodeUtf8Arrays'.

- encodeLatin1, encodeUtf8 don't fail when they encounter
  invalid characters. Their stricter variants encodeLatin1',
  encodeUtf8' do.

- encodeUtf8_, encodeLatin1_ drop the invalid characters.

- decodeUtf8 replaces any invalid character encountered with the
  Unicode replacement character where as decodeUtf8' fails.

- decodeUtf8Arrays doesn't fail on invalid characters anymore
  it replaces them with the Unicode replacement character.

- Deprecate decodeUtf8Lax, encodeLatin1Lax, encodeUtf8Lax.

- Update Changelog.md.
2020-09-17 12:16:11 +05:30
pranaysashank
ad05792d0b Deprecate Streamly module and move the exports to Streamly.Prelude.
- Deprecate and replace functions:
    foldWith => concatFoldableWith
    foldMapWith => concatMapFoldableWith
    forEachWith => concatForFoldableWith
2020-09-09 20:56:24 +05:30
adithyaov
e218fb9d8f Deprecate Streamly.Memory.Array
According to the new module structure, it should be Streamly.Data.Array.Storable.Foreign
2020-09-04 16:55:16 +05:30
adithyaov
aa1e4e137f Rename Streamly.Internal.Memory.Array
According to the new module structure, it should be Streamly.Internal.Data.Array.Storable.Foreign
2020-09-04 16:55:16 +05:30
adithyaov
4070c13937 Rename Streamly.Internal.Memory.Array.Types
According to the new module structure, it should be Streamly.Internal.Data.Array.Storable.Foreign.Types
2020-09-04 16:55:16 +05:30
adithyaov
e3e69a11ea Rename Streamly.Internal.Memory.Unicode.Array
According to the new module structure, it should be Streamly.Internal.Unicode.Array.Char
2020-09-04 16:55:16 +05:30
adithyaov
7d008199aa Deprecate Streamly.Data.Unicode.Stream
According to the new module structure, it should be Streamly.Unicode.Stream
2020-09-04 16:55:16 +05:30
adithyaov
d3325c60f6 Rename Streamly.Internal.Data.Unicode.Stream
According to the new module structure, it should be Streamly.Internal.Unicode.Stream
2020-09-04 16:55:16 +05:30
pranaysashank
c8c161c34b Rename module Internal.Prelude to Internal.Data.Stream.IsStream. 2020-08-24 00:29:25 +05:30
Pranay Sashank
960def155f Make the finalizer based exception handling routines the default.
- Change the handlers for both streams and unfolds.
2020-08-23 11:50:59 +05:30
Harendra Kumar
1639cfde98 Use monadic action to get the initial state
In ReaderT/StateT evaluation.
2020-08-19 19:41:08 +05:30
adithyaov
ead1601148 Replace Data.Strict with Data.*.Strict
"Streamly.Internal.Data.Strict" is replaced by:
Streamly.Internal.Data.Tuple.Strict
Streamly.Internal.Data.Maybe.Strict
Streamly.Internal.Data.Either.Strict

This commit also has some formatting changes to imports.
2020-08-14 20:25:52 +05:30
pranaysashank
d93ac86607 Drop support for GHC 7.10.3. 2020-08-12 11:24:34 +05:30
Harendra Kumar
ec97cec4d2 Fix the backtrack buffer management for fromParserK
This commit results in worse performance because now we are double
buffering once in ParserD and once in ParserK. This can potentially be
fixed but would require bigger changes to unify the backtracking buffer
management for ParserD and ParserK.
2020-08-02 16:26:46 +05:30
adithyaov
ef7c6d9633 Skip building Array.Prim.* modules for ghc < 8.0
getSizeofMutableByteArray# does not exist for versions of ghc below 8
2020-07-21 09:13:31 +05:30
adithyaov
4d0631a0c6 Add Data.Array.Prim.Pinned and Data.Array.Prim
Respect the new module structure for Internal files
2020-07-21 09:13:31 +05:30
adithyaov
27c3aebbce Combine all the array benchmarks to reduce duplication
Use --stream-size for all the array benchmarks now

Replace the following files:
- benchmark/Streamly/Benchmark/Data/Array.hs
- benchmark/Streamly/Benchmark/Data/ArrayOps.hs
- benchmark/Streamly/Benchmark/Data/Prim/Array.hs
- benchmark/Streamly/Benchmark/Data/Prim/ArrayOps.hs
- benchmark/Streamly/Benchmark/Data/SmallArray.hs
- benchmark/Streamly/Benchmark/Data/SmallArrayOps.hs
- benchmark/Streamly/Benchmark/Memory/Array.hs
- benchmark/Streamly/Benchmark/Memory/ArrayOps.hs
With:
- benchmark/Streamly/Benchmark/Array.hs
- benchmark/Streamly/Benchmark/ArrayOps.hs
2020-07-20 01:44:18 +05:30
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