moleculerjs / moleculer-channels

Reliable messages for Moleculer services via external queue/channel/topic.
MIT License
75 stars 15 forks source link

benchmark sendToChannel vs emit #66

Closed ujwal-setlur closed 1 year ago

ujwal-setlur commented 1 year ago

Do we have benchmarks of sendToChannel vs emit? I see a huge performance penalty while running a load test. with emit I can ingest and emit around 14K messages/sec, while with sendToChannel, I can send about 300 messages/sec. I am using with context. This seems to be a very drastic difference...

ujwal-setlur commented 1 year ago

Ok, I am tweaking some code, but emit is still way faster than sendToChannel

vitaly-z commented 1 year ago

https://github.com/moleculerjs/moleculer-channels#benchmark https://github.com/moleculerjs/moleculer-channels/tree/master/benchmark

Emit will be significantly faster than sendToChannel anyway, because by design sendToChannel is a guaranteed delivery, while "emit" is send-and-forget

ujwal-setlur commented 1 year ago

Thanks for the link! I didn’t notice it. I will compare the numbers. I’ll close this for now.