tag:blogger.com,1999:blog-970528744702948483.post4696605595262363909..comments2023-04-10T05:46:19.850-07:00Comments on Concurrent future...: Erlang process mailbox performanceDude From Mangalorehttp://www.blogger.com/profile/11648794788677197501noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-970528744702948483.post-63149364260468049102010-01-27T09:08:33.000-08:002010-01-27T09:08:33.000-08:00Thanx for the comments...
You are right.. This i...Thanx for the comments... <br /><br />You are right.. This is the exact point I wanted to make here. I have heard some people saying Erlang is slow.. and it turned out that they found it slow because they were not using it in the right way.. <br /><br />One more thing here to note is that, the time complexity of first method is O(N + (N-1) + (N-2)....+1). In the 2nd method, the time complexity is reduced to O(N).Dude Mangalorenoreply@blogger.comtag:blogger.com,1999:blog-970528744702948483.post-85467015233409785862010-01-25T09:47:39.000-08:002010-01-25T09:47:39.000-08:00The issue you are describing in related to the fol...The issue you are describing in related to the following:<br /> * as you start the processes, they get scheduled in the order they're started; thus the first one starts and sends a message, then the second one, etc.;<br /> * as you start processes you accumulate them in reverse order;<br /> * thus when you do a receive you're actually waiting for the last process to send you a message, and so you postpone the other messages that have already been received;<br /> * in the second case (where you reverse the accumulating list), you wait for the first process to send, then you wait for the second, etc.; thus you receive messages in "parallel" as the workers are scheduled;<br /><br />So the performance penalty you observe is justified.ciprian.craciun@gmail.comnoreply@blogger.com