QueueChannel Perfomances

118 views
Skip to first unread message

Alexis Chaupin

unread,
Jan 20, 2013, 2:43:45 PM1/20/13
to retla...@googlegroups.com
Hi,

I am new with Retlang.
I would like to use Retlang in order to queue actions and execute them on the first ThreadFiber available. (Looking for high perf : at least 1MillionMsg/sec)

For that I used a QueueChannel but my benchmark returns strange results :

#Results with the number of ThreadFiber subscribed to the QueueChannel :
1 ThreadFiber ~= 1sec
2 ThreadFibers ~=> 3sec
3 ThreadFibers ~=> 5sec
4 ThreadFibers ~=> 8sec
5 ThreadFibers ~=> 10sec

Code : http://pastebin.com/jf4iWXVS

I was expecting a decrease in the processing time of dequeuing.

Thanks for you help,
Alex

Mike Rettig

unread,
Jan 22, 2013, 2:06:12 PM1/22/13
to retla...@googlegroups.com
The receive method does nothing so most of the time is spent context switching and thrashing on locks. This will cause the total execution time to be dramatically slower. A queue channel will only be faster if the receive method actually takes a few cycles. Also, if you just want parallel execution, then the standard .NET thread pool works fine. 

Mike



--
You received this message because you are subscribed to the Google Groups "retlang-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/retlang-dev/-/kIJvMD0KWrEJ.
To post to this group, send email to retla...@googlegroups.com.
To unsubscribe from this group, send email to retlang-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/retlang-dev?hl=en.


Alexis Chaupin

unread,
Jan 22, 2013, 3:15:28 PM1/22/13
to retla...@googlegroups.com
Ok Mike,
Thanks for your advice

- Alexis
Reply all
Reply to author
Forward
0 new messages