This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Is Scala binding slowing down the ZeroMQ throughput

3 replies
vhazrati
Joined: 2011-01-12,
User offline. Last seen 1 year 6 weeks ago.

We are using a pull push mechanism similar to the perf tests specified here for ZeroMQ.http://www.zeromq.org/results:perf-howto

For the throughput test with a message size of 4.3KB and 100,000 messages i get a performance of 85K msg/sec

vikas@vikas-laptop:~/w/software/exploded/zeromq-2.1.10/perf$ local_thr tcp://127.0.0.1:5555 4300 100000
message size: 4300 [B]
message count: 100000
mean throughput: 85203 [msg/s]
mean throughput: 2930.983 [Mb/s]

However with the code in Scala and using the Scala binding 0.0.3 i get less than 15K msg/sec.

Gist here https://gist.github.com/1496406

Could you please let me know what is going wrong or does the Scala code need some tweaking?


Regards | Vikas
Viktor Klang
Joined: 2008-12-17,
User offline. Last seen 1 year 27 weeks ago.
Re: Is Scala binding slowing down the ZeroMQ throughput
1) Avoid creating a new bytebuffer for each iteration.
2) Avoid benching Scala Actors
3) Avoid for(...) for high-performance "loops" (will be faster in 2.10)

Cheers,


On Tue, Dec 20, 2011 at 8:16 AM, Vikas Hazrati <vhazrati@inphina.com> wrote:

We are using a pull push mechanism similar to the perf tests specified here for ZeroMQ.http://www.zeromq.org/results:perf-howto

For the throughput test with a message size of 4.3KB and 100,000 messages i get a performance of 85K msg/sec

vikas@vikas-laptop:~/w/software/exploded/zeromq-2.1.10/perf$ local_thr tcp://127.0.0.1:5555 4300 100000
message size: 4300 [B]
message count: 100000
mean throughput: 85203 [msg/s]
mean throughput: 2930.983 [Mb/s]

However with the code in Scala and using the Scala binding 0.0.3 i get less than 15K msg/sec.

Gist here https://gist.github.com/1496406

Could you please let me know what is going wrong or does the Scala code need some tweaking?


Regards | Vikas



--
Viktor Klang

Akka Tech LeadTypesafe - Enterprise-Grade Scala from the Experts

Twitter: @viktorklang
vhazrati
Joined: 2011-01-12,
User offline. Last seen 1 year 6 weeks ago.
Re: Is Scala binding slowing down the ZeroMQ throughput
Viktor
1) We are creating a new bytebuffer to get a somewhat realistic feel since all are messages are going to be different 3) Do you recommend while or parallel for?
2) Did you not quite understand what you meant by benching?
We are using Akka 1.3-RC4 and Akka actors as of now.
Thanks | Vikas

2011/12/20 √iktor Ҡlang <viktor.klang@gmail.com>
1) Avoid creating a new bytebuffer for each iteration.
2) Avoid benching Scala Actors
3) Avoid for(...) for high-performance "loops" (will be faster in 2.10)

Cheers,


On Tue, Dec 20, 2011 at 8:16 AM, Vikas Hazrati <vhazrati@inphina.com> wrote:

We are using a pull push mechanism similar to the perf tests specified here for ZeroMQ.http://www.zeromq.org/results:perf-howto

For the throughput test with a message size of 4.3KB and 100,000 messages i get a performance of 85K msg/sec

vikas@vikas-laptop:~/w/software/exploded/zeromq-2.1.10/perf$ local_thr tcp://127.0.0.1:5555 4300 100000
message size: 4300 [B]
message count: 100000
mean throughput: 85203 [msg/s]
mean throughput: 2930.983 [Mb/s]

However with the code in Scala and using the Scala binding 0.0.3 i get less than 15K msg/sec.

Gist here https://gist.github.com/1496406

Could you please let me know what is going wrong or does the Scala code need some tweaking?


Regards | Vikas



--
Viktor Klang

Akka Tech LeadTypesafe - Enterprise-Grade Scala from the Experts

Twitter: @viktorklang



--
Best Regards | Vikas

Inphina Technologies Co-Founder and Technical Architect
+91-9899174194
Check out our thoughts @ http://goo.gl/jrKfn

Viktor Klang
Joined: 2008-12-17,
User offline. Last seen 1 year 27 weeks ago.
Re: Is Scala binding slowing down the ZeroMQ throughput
Hi Vikas,

2011/12/20 Vikas Hazrati <vhazrati@inphina.com>
Viktor
1) We are creating a new bytebuffer to get a somewhat realistic feel since all are messages are going to be different

But that's just completely false, it's not doing that. If you want to bench message sends you need to remove the other factors, or make sure that they are the same no matter the language used.
 
3) Do you recommend while or parallel for?

while or tail recursion.
 
2) Did you not quite understand what you meant by benching?

benching == slang for benchmarking
If you put pressure on the wrong component, you're effectively measuring the performance of that component.

Cheers,

 
We are using Akka 1.3-RC4 and Akka actors as of now.
Thanks | Vikas

2011/12/20 √iktor Ҡlang <viktor.klang@gmail.com>
1) Avoid creating a new bytebuffer for each iteration.
2) Avoid benching Scala Actors
3) Avoid for(...) for high-performance "loops" (will be faster in 2.10)

Cheers,


On Tue, Dec 20, 2011 at 8:16 AM, Vikas Hazrati <vhazrati@inphina.com> wrote:

We are using a pull push mechanism similar to the perf tests specified here for ZeroMQ.http://www.zeromq.org/results:perf-howto

For the throughput test with a message size of 4.3KB and 100,000 messages i get a performance of 85K msg/sec

vikas@vikas-laptop:~/w/software/exploded/zeromq-2.1.10/perf$ local_thr tcp://127.0.0.1:5555 4300 100000
message size: 4300 [B]
message count: 100000
mean throughput: 85203 [msg/s]
mean throughput: 2930.983 [Mb/s]

However with the code in Scala and using the Scala binding 0.0.3 i get less than 15K msg/sec.

Gist here https://gist.github.com/1496406

Could you please let me know what is going wrong or does the Scala code need some tweaking?


Regards | Vikas



--
Viktor Klang

Akka Tech LeadTypesafe - Enterprise-Grade Scala from the Experts

Twitter: @viktorklang



--
Best Regards | Vikas

Inphina Technologies Co-Founder and Technical Architect
+91-9899174194
Check out our thoughts @ http://goo.gl/jrKfn




--
Viktor Klang

Akka Tech LeadTypesafe - Enterprise-Grade Scala from the Experts

Twitter: @viktorklang

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland