Commit Graph

140 Commits

Author SHA1 Message Date
Harendra Kumar
d4363a8ad7 Add loop tests 2017-08-28 02:09:08 +05:30
Harendra Kumar
86f575d6de simplify pullworker code 2017-08-28 00:40:17 +05:30
Harendra Kumar
5db931586e Simplify push code 2017-08-28 00:23:14 +05:30
Harendra Kumar
2cc5c120ac Move a test code block 2017-08-27 08:08:48 +05:30
Harendra Kumar
064bb7e2cd Some simplifications 2017-08-27 08:08:18 +05:30
Harendra Kumar
bdaefb3cff Reuse threads instead of creating fresh every time
Improved the empty thread benchmark by more than 5 times.  Work is now queued
to a common queue and all the worker threads pick it up from there.
2017-08-27 02:23:21 +05:30
Harendra Kumar
e8a746382d Use TBQueue instead of an unbounded channel 2017-08-26 03:03:45 +05:30
Harendra Kumar
b3faafaecb Solve the problem of last dispatch blocking drain
By always having the last dispatch in another thread. This has significant
impact on performance due to an extra thread or some other reason?
2017-08-25 23:58:38 +05:30
Harendra Kumar
2248afac5e Simplify runner functions 2017-08-25 23:38:54 +05:30
Harendra Kumar
ab91267967 Add test case for hierarchical alternative composition 2017-08-25 23:38:06 +05:30
Harendra Kumar
5181c0d15f Fix warning in benchmark 2017-08-24 03:49:32 +05:30
Harendra Kumar
1f01190cca Fix bug due to typo in pull finalizer and move it 2017-08-24 03:46:44 +05:30
Harendra Kumar
a61b30ba71 Fix, delete, move examples 2017-08-24 03:45:29 +05:30
Harendra Kumar
02a745f8e9 update examples README 2017-08-24 03:08:06 +05:30
Harendra Kumar
7beefcec67 Fix examples 2017-08-24 03:07:14 +05:30
Harendra Kumar
b68840b6e6 Add some more examples 2017-08-24 02:22:49 +05:30
Harendra Kumar
5349a44ef3 update some examples 2017-08-24 02:16:02 +05:30
Harendra Kumar
d8c399e567 Implement tracking and killing of child threads 2017-08-22 21:45:58 +05:30
Harendra Kumar
36ecdf82e3 Perf - do not save pending work in the context 2017-08-22 17:17:35 +05:30
Harendra Kumar
6ec80a0f92 Fix draining of threads (serial instead of parallel) 2017-08-22 17:01:07 +05:30
Harendra Kumar
04fef4fe4f Move a function in dep order 2017-08-21 22:31:42 +05:30
Harendra Kumar
09283c42ac Implement pull based concurrency rate control 2017-08-21 21:10:09 +05:30
Harendra Kumar
b1ee90ec4e Add the yield API 2017-08-19 03:22:59 +05:30
Harendra Kumar
500d889859 Simplify push-pull split, fix monoid instance 2017-08-18 07:12:29 +05:30
Harendra Kumar
b2faaf91ba remove a couple of stale comments 2017-08-17 19:18:22 +05:30
Harendra Kumar
b38be3a834 Reduce channel communication for short tasks
Combine the last done message with yield
2017-08-17 19:07:37 +05:30
Harendra Kumar
91a6cee5ed Simplify push 2017-08-17 18:14:44 +05:30
Harendra Kumar
9b2ca30312 Add the "for" parallel API and change "each" to serial 2017-08-17 04:42:45 +05:30
Harendra Kumar
63f965a784 cleanup Monoid instance 2017-08-17 01:43:14 +05:30
Harendra Kumar
6ea73b3d10 Cleanup and refactor threading stuff 2017-08-17 01:29:56 +05:30
Harendra Kumar
e874ecf575 Remove quadratic complexity due to serially-in-serially 2017-08-16 15:18:17 +05:30
Harendra Kumar
8a1d5d995e Add a test for "each" to test multiple threads 2017-08-16 14:53:30 +05:30
Harendra Kumar
550eed458f Make monoid instance append two computations in order
Conflicts:
	test/Main.hs
2017-08-15 18:41:20 +05:30
Harendra Kumar
ef006c846d Implement fork for Alternative instance 2017-08-15 18:36:26 +05:30
Harendra Kumar
9f7d672422 Simplify toList runner 2017-08-11 13:36:07 +05:30
Harendra Kumar
c9b9ab35db Pass context directly, removing the use of State monad 2017-08-11 12:59:33 +05:30
Harendra Kumar
6935930cae Add list-t to benchmarks 2017-08-10 15:25:28 +05:30
Harendra Kumar
f4cce2f9a3 Separate the bind and <|> semantics for parallelism 2017-08-10 15:24:47 +05:30
Harendra Kumar
7b52ccfff6 Partially fix the recording stuff
handlResult is still to be used
2017-08-10 00:13:05 +05:30
Harendra Kumar
f8851aa158 Add MonadRecorder instance to AsynclyT 2017-08-09 18:21:28 +05:30
Harendra Kumar
4f3775d51f Enable threads API and tests 2017-08-09 17:44:05 +05:30
Harendra Kumar
17b30bafb7 rename the runner APIs 2017-08-09 17:30:33 +05:30
Harendra Kumar
504800bebe More cleanup in RunAsync 2017-08-09 17:19:02 +05:30
Harendra Kumar
bb5a74d32a Some cleanups 2017-08-09 16:22:25 +05:30
Harendra Kumar
eca7d81223 Remove redundant composition primitives
These can be simulated using a wait on an event and lifting/discarding
the result.
2017-08-09 15:37:10 +05:30
Harendra Kumar
a20c180451 Some cleanup 2017-08-09 02:11:16 +05:30
Harendra Kumar
99d9ba6c07 Fix the composite benchmark code 2017-08-08 20:37:11 +05:30
Harendra Kumar
c1f0a867c3 Continuation based implementation
Seems to have similar (slightly worse) performance as the lazy impl without
continuations.

lazy-streaming witout continuations without StateT = 400 ms
with continuations without StateT = 550 ms

However with continuations we do not need SPECIALIZE which is a significant
advantage to freely use in any Monad wihtout worrying about perf.
2017-08-08 15:23:14 +05:30
Harendra Kumar
7e8209e2d6 Separate the State layer from AsyncT layer
Performance degrades by 2x

StateT/AsyncT combined = 560 ms
Separated AsyncT (StateT Context IO) = 1.2 s
AsyncT IO in the separated version = 400 ms
2017-08-07 19:55:38 +05:30
Harendra Kumar
4d7024fae0 Initial poc of lazy streaming 2017-08-07 15:15:09 +05:30