This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: performance problems
>>>>> "Jeff" == Jeff Sturm <jsturm@sigma6.com> writes:
Jeff> My benchmark program, a small web server written in java, runs
Jeff> about 30% faster with gcj than it does with the IBM JDK. That
Jeff> was with 2.95 prerelease code.
Is the IBM JDK a JIT?
Jeff> One thing I discovered that could affect others testing libgcj
Jeff> performance is that synchronized blocks in libgcj rely on
Jeff> pthread mutexes, which (at least on Linux) spin forever in a
Jeff> yield loop; they never go to sleep before they grab the lock.
Jeff> So long-term synchronized blocks should be avoided in favor of
Jeff> higher-level mechanisms based on wait/notify. (Anyone know what
Jeff> the JDK does?)
I don't know what the JDK does. I was unaware of this behavior in
LinuxThreads.
The current thread code in libgcj was designed for simplicity. I have
never done any profiling to see how fast or slow it might be. We can
change it, even on a per-OS basis (e.g., a Linux-specific
implementation), if that would help a lot.
Does the slowness of synchronized blocks contribute greatly to
slowdowns in real programs?
Jeff> I should probably mention this to the LinuxThread maintainer,
Jeff> whoever that is...
Here is the LinuxThreads home page:
http://pauillac.inria.fr/~xleroy/linuxthreads/
Presumably there is a bug reporting address somewhere on the page.
Tom