Name: tb29552 Date: 11/04/98
Turtlespeed_Server.java:
The server is listening on Port 523.
When a connection is comming in, the class Connection is used to accept
the client.
The run function reads a string from the client, adds a number an
returns it to the
client. The Server stops when it's reading #finish# .
Turtlespeed_Client.java:
The client is contacting the loopback-device on Port 523.
A connection to the Server is created and 5 strings are sent. The
returned strings are
put to the console.
-----------------------------------------------------------------------------
My configuration (NT 4.0 Sp3):
AMD K6-200
128MB Dimm
3c900 Network Interface Card
JRE 1.1.7 or Java Workshop 2.0 (incl. Service Pack)
The client needs about 5sec to get the 5 strings from the server.
My configuration (Linux 2.0.35)
Intel P200
32MB Edo
Realtek 8029 NIC
The Kernel supports java
The client needs less then 1sec !!!!
---------------------------------------------------------------------------------
I took the Profiler included in the Workshop. I found out that readUTF
needs the most time.
In my case it cumulative time is 2001ms and it is called 6 times. One
readUTF needs
333.5 msec. With the Profiler you can see that DataInputStream.readUTF
calls
DataInputStream.readUnsignedShort. This function is wasting the time.
It is declared as native, so I can't look inside it.
My question:
Why is the Java Virtual Machine so slow? What can I do to speed up my
program?
At developer.javasoft.com if found a bug report. It's number is 4106792.
It's about
a performance-problem also including java.net.
Best reguards,
Bernhard Boeck
MB-Computersysteme Ges.m.b.H.
Kohlstatt 19
A-4893 Zell am Moos
Austria
(Review ID: 40394)
======================================================================