-
C++ vs. Java on Sender (Client) side (3 messages)
- Posted by: Amir Yiron
- Posted on: January 05 2010 07:58 EST
I make a benchmark comparing C++ vs Java networking performance, having a single client which sends packets contionously to the server. The C++ and Java servers behaves the same, however the C++ client has much better (*2.5) throughput than Java. I tried to improve the Java (unsuccessfully!) by the following: - use combinations of socket options - set client thread priority higher - use vm flags: -client, -Xnoclassgc (no GC !!!) - set net. card configuration I noticed that while C++ uses 50% of the bandwidth, Java uses only 20% - and the graph is very stable! What else can I do to improve Java? Thanks in Advance!Threaded Messages (3)
- Platform is Windows XP SP2 by Amir Yiron on January 05 2010 11:48 EST
- Re: C++ vs. Java on Sender (Client) side by Kees Jan Koster on January 05 2010 14:24 EST
- Strange Profiler Results... by Amir Yiron on January 07 2010 11:06 EST
-
Platform is Windows XP SP2[ Go to top ]
- Posted by: Amir Yiron
- Posted on: January 05 2010 11:48 EST
- in response to Amir Yiron
I forgot to mention... -
Re: C++ vs. Java on Sender (Client) side[ Go to top ]
- Posted by: Kees Jan Koster
- Posted on: January 05 2010 14:24 EST
- in response to Amir Yiron
Dear Amir, I would run your Java client in a profiler and see where it spends most of its time. Then optimize that. GC is not likely to be a problem for simple applications. In fact, you did yourself a disservice by using the -client flag. Use -server (always use -server) I did some benchmarking http://java-monitor.com/forum/showthread.php?t=552 -Xnoclassgc does not disable the GC, so don't bother. You cannot disable the GC. Kees Jan -
Strange Profiler Results...[ Go to top ]
- Posted by: Amir Yiron
- Posted on: January 07 2010 11:06 EST
- in response to Amir Yiron
Profiling my client shows a very strange results: after 7 min the following values grow twice: heap size, heap used, loaded classes. After 7 more min. heap size/used decreases, but still remain larger than in the beginning. After more 15 min, the network bandwidth grows from 20% to 55%, and sending rate grows from 17 Mbps to 54 Mbps !!!! ANY EXPLANATIONS ???