[spread-users] Interface: java vs C

Datoh datoh at free.fr
Fri Nov 19 08:38:46 EST 2004


Hi,

I would like to continue your previous discussion about messages reception
time.
Alberto Martinez was surprised by its responses time (about 40ms).
And Yair Amir answered the response should be around 3ms as it is
described in this article:
http://www.cnds.jhu.edu/pub/papers/cnds-2004-1.pdf

I have the same responses time than Alberto, and just like me, he uses
the java interface to connect to the daemon. So I had the idea to
compare the two interfaces: java and C.

I implemented a simple client/server program in C and in java.
I used a single PC for the test with a spread daemon, a client and a server.
The server multicasts messages (the number of messages, the time in ms
between each messages and the size of the messages are given in 
parameters). Then, the client simply receives the messages and displays 
the delivering time. The results are amazing:

- With a low workload (200ms between two multicasts):
With C interface, the first message is delivered in 40ms and the rest in 
3-7ms.
With java interface, the n first messages are delivered in 40ms and
the rest in 3-7ms. n depends on of the size the message, as long as the 
size of a message increases, n decreases.

I launched a test on three completely different PCs and the results are
the same. I also used two PCs (2 daemons, 2 clients and 1 server) in
three different clusters of PCs and the results still the same (I assume
the clocks of the PCs are synchronized).

I used jdk 1.4.2 and 1.5 and the last version of spread (daemon and 
interface): 3.17.3.

It seems that there is a buffer problem with the java interface, the 
messages are multicasted faster when the buffer is full.
Can you confirm my result?

I join spread.conf, the server and the client in C and in java.

Datoh.

java interface:
spread –n node0 –c spread.conf &
java TestSpreadClient 20 &   (receive 340 messages)
java TestSpreadSvr 20 200 5000 &   (multicast 340 messages with 200ms
between each message - the size of a message is around 5000 byte)

C interface:
spread –n node0 –c spread.conf &
./TestSpreadClient 20 &   (receive 340 messages)
./TestSpreadSvr 20 200 5000 &   (multicast 340 messages with 200ms 
between each message - the size of a message is around 5000 byte)

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: TestSpreadSvr.c
Url: http://lists.spread.org/pipermail/spread-users/attachments/20041119/ccad2dec/attachment.c 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestSpreadSvr.java
Type: text/x-java
Size: 1137 bytes
Desc: not available
Url : http://lists.spread.org/pipermail/spread-users/attachments/20041119/ccad2dec/attachment.bin 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: spread.conf
Url: http://lists.spread.org/pipermail/spread-users/attachments/20041119/ccad2dec/attachment.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: TestSpreadClient.c
Url: http://lists.spread.org/pipermail/spread-users/attachments/20041119/ccad2dec/attachment-0001.c 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestSpreadClient.java
Type: text/x-java
Size: 1131 bytes
Desc: not available
Url : http://lists.spread.org/pipermail/spread-users/attachments/20041119/ccad2dec/attachment-0001.bin 


More information about the Spread-users mailing list