jberryman / unagi-chan

A haskell library implementing fast and scalable concurrent queues for x86, with a Chan-like API
BSD 3-Clause "New" or "Revised" License
127 stars 15 forks source link

Realistic use-cases for benchmarking #8

Open jberryman opened 10 years ago

jberryman commented 10 years ago

I'd love to have some small, example programs that each represent some realistic use-case. These would supplement the existing benchmarks which do a good job of measuring the effects of contention and descheduling, and throughput.

Helping

If you have a use-case it would be a great help if you could package it up as a single file living under benchmarks/realistic/ and submit a pull request. I'll then integrate it into the benchmark suites in some way, and use it to guide future development.

If applicable the function you export can take Int arguments for configuring number of threads and iterations.

lukehoersten commented 9 years ago

I'm working on integrating with io-streams in the unagi-streams package. Not sure of there will be much overhead but it may open up some use cases.

jberryman commented 9 years ago

Hi Luke, that sounds like a cool project; definitely please report back if you can think of anything you think should be added to the benchmark suite.

Also, this is somewhat timely as I'm working on a variant that omits blocking reads and also uses a Stream type to support reads that can omit all coordination with other readers and writers. I've just documented the work so far in #11.

It would be great if you could take a look and continue this discussion in that issue if you have any thoughts. It's been on my radar to read this, but I haven't done any thinking yet about how that interface might be able to integrate with streaming libs.

jberryman commented 9 years ago

A good place to start might be to try to copy some of the more interesting benchmarks used in The LMAX (don't-call-it-a-queue) Disruptor™ here, as it sounds like they've put a lot of thought into them.