Top
Best
New

Posted by kelindar 6 days ago

Event – Fast, In-Process Event Dispatcher(github.com)
169 points | 37 commentspage 2
DmitryOlshansky 5 days ago|
> Generic: Works with any type implementing the Event interface.

Isn’t this the opposite? Generic is usually implying any type would do.

mexicocitinluez 5 days ago|
You can constrain a generic, so no.

Generics don't mean "any type", they mean "type argument". As such, you can say "only type arguments that implement X" or similar.

st3fan 5 days ago|
"Processes millions of events per second" - yes, sure, when there is nothing to process. But that is not representative of a real app.

Add a database call or some simple data processing and then show some numbers comparing between channels or throughput.

I hate these kind of claims. Similar with web frameworks that shows reqs/s for an empty method.

scripturial 5 days ago||
How else do you compare “web frameworks” except foe comparing their overhead?

No everyone wants to write a database application. There are absolutely other types of applications in the world. Applications can be CPU and/or memory bound.

catlifeonmars 5 days ago|||
I see what you’re getting at, but if you add a database call the I/O blocking time will completely eclipse CPU time. It would not be a useful comparison, similar to if you added a time.Sleep to each event handler.
hinkley 5 days ago|||
The reviews by some other people here lead me to believe that it works fairly well both when there is something to process and when it's just chattiness.

If you mean Amdahl's Law (and maybe Little), messaging is generally considered part of the unavoidable. However TCP and this library both seem to be aware that while you cannot eliminate messaging overhead, you can amortize it over dozens and dozens of messages at a time and that reduces that bit of serialized cost by more than an order of magnitude.

thinkharderdev 5 days ago||
> But that is not representative of a real app

Many, many real apps process millions of events per second. You may not have worked on any of them but that does not mean they don't exist.