Ok, so. When you need to write a load balancer and want to test different languages for the task, you don't do a benchmark like that one.<p>Writing a "ping-pong"? And not using the same client to test both servers?<p>It would not have been too hard to write a simple proxy in both languages. Not even worrying about parsing HTTP headers, just testing TCP, that is really easy.<p>Now, if you really want to test the performance, you have to implement it differently. Just two small features you would need in both:<p>* non blocking IO: right now, you're starting a new future in Scala, that's easy to write but not really efficient (it might work better with goroutines)
* zero copy: if you're load balancing, you will spend your time moving bits, so you'd better make sure that you don't copy them too much. It is possible with Scala, but it looks like Go does not support it<p>Now, when you have reasonable testing grounds (that woudn't be more that a hundred lines in both languages), better get your statistics right.<p>"The client would make 100 concurrent connections and send a total of 1 million pings to the server, evenly distributed over the connections. We measured the average round trip time" -> that is NOT how you should test. Here, you would want to know what is the nominal pressure the balancer could handle, so you must measure a lot of metrics:<p>* RTT
* bandwidth (per user and total)
* time to warmup (the JVM optimizes a lot of things on the fly, you have to wait for it)
* operational limits (what is the maximal bandwidth for which the performance crashes? same for number of users)<p>And then, you don't measure only the average values. You must measure the standard deviation. Because you could have a good average, but wildly varying data, and that is not good.<p>Last thing: the macbook may not be a good testing system.