[erlang-questions] Re: 20k messages in 4s but want to go faster!

Joel Reymont <>
Mon Jul 13 09:34:15 CEST 2009


On Jul 13, 2009, at 6:57 AM, Jim Morris wrote:

> Actually Tony has a good point, I presumed Joel was doing it that way.

And I was.

> Not sure if having a list of 8,000 TCP sockets and iterating over them
> sending to each socket from a single process would be any slower, I
> never tried that approach.

It must positively be slower. I once measured the overhead of a message
send to be 10x over a function call, maybe not precisely that but still
_many_ times slower. A data point for all you out there trying to  
implement
objects as processes.

> So Joel do you have one process per client or iterate over a list of
> sockets?

gen_server is even slower than a regular message send so I can't imagine
a circumstance where taking a trip through a socket-fronting process
can be faster than sending to the socket directly.

On to fix my measurements!

---
Mac hacker with a performance bent
http://www.linkedin.com/in/joelreymont



More information about the erlang-questions mailing list