pkolaczk / async-runtimes-benchmarks

103 stars 33 forks source link

Add a Haskell implementation #6

Open chrismwendt opened 1 year ago

chrismwendt commented 1 year ago

stack run coroutines 1000000 (1M) uses 12GB of RAM on my machine.

runjak commented 1 year ago

Hey 👋

I've also tried my hands at a Haskell implementation, and it's at runjak/async-runtimes-benchmarks.

While I was aware of Control.Concurrent.Async I went with Control.Concurrent.Chan instead (and quite a long list, that I suspect growing slow). How would you feel about introducing separate subdirectories?

I must also admit that I went for a bit of a more naïve setup (no stack, no cabal, only ghc ^^).

Anyway, in terms of results - I'm aiming to write them up a bit more, but so far I got 575428 and 694560 the results.

runjak commented 1 year ago

I think the decision around RTS stuff makes a big difference with Haskell.

Most recent changes on my end get 465220 (<470MB) for 1M when running single threaded, but 9611132 (>9.6GB) when compiling with -threaded -rtsopts -with-rtsopts=-N and running on 8 threads.

runjak commented 1 year ago

Sorry for being so spammy. Upon further investigation I'm not currently confident that my attempts actually run as concurrent as desired.

With your code I get comparable memory usage - which is somewhat unexpected to me, but quite interesting nevertheless.

Thanks for sharing it 🙏