Commit Graph

823 Commits

Author SHA1 Message Date
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
Harendra Kumar
11c1f14755 Add some simple tests 2017-08-07 15:14:41 +05:30
Harendra Kumar
c49732a7a6 Move the each primitive to right place 2017-08-04 13:31:38 +05:30
Harendra Kumar
cc4743cb5f Add machine benchmark and fix others 2017-08-04 13:30:40 +05:30
Harendra Kumar
4d4894c6f1 Move the thread contol primitive to threads module 2017-07-21 14:13:55 +05:30
Harendra Kumar
3c7a92a35d Move around some code 2017-07-21 14:03:36 +05:30
Harendra Kumar
0d9243fc0a Separate the threadstate management layer 2017-07-21 13:54:02 +05:30
Harendra Kumar
31b3b5b1d0 Rename the Threads module 2017-07-21 11:30:47 +05:30
Harendra Kumar
3ed5abc542 Add some more SPECIALIZE and INLINE pragmas 2017-07-19 12:49:41 +05:30
Harendra Kumar
ce6719a6b8 More SPECIALIZE and CAS for atomicmodify 2017-07-19 11:17:02 +05:30
Harendra Kumar
b7d651f24d SPECIALIZE monad, alternative and each for IO 2017-07-19 10:47:51 +05:30
Harendra Kumar
9ec9c527e3 add noinline pragma for bind 2017-07-19 08:58:15 +05:30
Harendra Kumar
e1fc30a63c Remove additional binds, change continuations model 2017-07-19 08:43:52 +05:30
Harendra Kumar
59c0bac57b Change foldl to foldr in "each" 2017-07-19 08:16:02 +05:30
Harendra Kumar
5457bbd10f Add asyncly to benchmarks 2017-07-19 08:10:56 +05:30
Harendra Kumar
b1068152b7 Add benchmarks including transient 2017-07-17 21:28:04 +05:30
Harendra Kumar
d64225fe30 Reorganize code top to bottom in dependency order
for AsyncT.hs
2017-07-16 17:49:07 +05:30
Harendra Kumar
1be7567d2b Remove redundant unsafeCoerce 2017-07-15 13:20:34 +05:30