Open Jakobi-mirsk opened 2 years ago
a follow up on this is that i just tested emitting a 1000 small packeges in 2 different ways. First way, was to use the Parallel object. This resulted in really slow performance of this library. the second way was to send the packages synchronously from the main thread of my test app. this showed good performance. How come we have this difference in performance. I would have thought that doing things in parallel would be faster.
Hi, please show your test code. thank you very much🤗
I don't have code that can easily be put in here but basically calling socket.EmitAsync in a while loop 1000 times is very fast compared to calling it from:
Parallel.For(0, 1000, new Action
Even If you use parallel execution you have to consider that is being shared a socket connection, that by using some locks (to guarantee that a message will not be misformed), will slow down the send.
It's like many people trying to enter a train at the same time. It's faster making a queue. 😬
thanks for the update, i will consider it
hi We are investigating a problem where sending using EmitAsync seems slow to actually send the request, when we are making many requests. Is is possible get a version where we can Emit synchronously?