Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Nov 2006 06:28:29 +0200
From:      Nikos Ntarmos <ntarmos@ceid.upatras.gr>
To:        freebsd-java@freebsd.org
Subject:   Re: Performance of Java on FBSD vs. others...
Message-ID:  <20061111042829.GB88440@ace.b020.ceid.upatras.gr>
In-Reply-To: <20061110142436.G88944@turing>
References:  <20061110203714.GA89006@ace.b020.ceid.upatras.gr> <20061110124459.M88944@turing> <20061110213313.GA72658@ace.b020.ceid.upatras.gr> <20061110142436.G88944@turing>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi again.

On Fri, Nov 10, 2006 at 02:33:33PM -0800, Nick Johnson wrote:
> On Fri, 10 Nov 2006, Nikos Ntarmos wrote:
> 
> >>What about default GC tuning options? These can be platform-dependent.
> >>You may want to explicitly set these to compare apples to apples.
> >
> >My main consideration is not the fairness of the comparison but the
> >difference in speed. I've tried all possible -X combinations but
> >(guessed it?) without any noticeable difference; FreeBSD remains the
> >lagger...
> 
> How can you compare differences in speed without comparing in the same set of 
> circumstances?  Otherwise, you're comparing apples to oranges and the 
> comparison is not valid.

Ummm... It looks more like "apples under freebsd" and "apples under
linux or win32" to me... :)

> >I was thinking something along the lines of "there are bits and pieces
> >of jre/jdk implemented in native code and fbsd doesn't have'em yet", or
> >(hopefully) "you have to sysctl-turn a.b.c on"...
> 
> I can't imagine there is anything like that, since what gets compiled with the 
> port (and what's included in the package) is a stock Sun JVM with patches 
> applied to get it to compile and run correctly on FreeBSD.

That's what my intuition told me as well. However, it seems that that's
not the case after all... I was looking into visualgc, then jconsole,
then into various arcane java knobs, and came to the conclusion that the
only way I can make, say, linux to perform as bad as freebsd was by
turning JIT off (as in 'java -Xint ...'). Then I stumbled upon this
(very dated) document: http://www.freebsd.org/java/docs/performance.html.
It compares JDK 1.1.8 on linux and freebsd and its findings are similar
to mine. The bad thing is that I can't reproduce those figures since (i)
the tests in that document were run in Dec '99, (ii) patrick@ is listed
as a freebsd alumni until 2004, and (iii) Pendragon Software doesn't
produce Caffeine Mark anymore.

It appears like JIT isn't quite as good on BSDs as it is on linux or
win32 or solaris. I scoured through the source code of the JDK and it's
crawling with ifdef's where solaris and linux seem to be better
instrumented than BSDs...

> Did you compile the port or did you use the precompiled binary?

Both. Diablo-jdk15 (as in java/diablo-jdk15) comes precompiled for
freebsd-6 (needs libc.so.6 -> libc.so.7 mappings in libmap.conf), while
sun-jdk15 (as in java/jdk15) comes in source code form only.

> It's also conceivable that the other platform JVMs are compiled with a
> more aggressive set of compiler optimizations, etc.  You may notice a
> difference if the port is compiled with "CPUTYPE?=i686" in
> /etc/make.conf, for example.  I can't really say for sure.

The latter was compiled with CPUTYPE?=pentium-m and COPTFLAGS+=-O2. I'd
like to also test compiling it with icc, but can't make my way through
intel's web site... :(

> Have you tried attaching to the JVM with VisualGC to watch what's
> going on in memory?  Perhaps things are allocated differently by
> default on the different platforms.

Yes. I tried both visualgc and the (seemingly newer) jconsole. There is
no noticeable difference, other than the seer speed difference.

> How was your kernel compiled?  There are certainly tweaks to kernels
> that can make a major difference in performance.  The default Generic
> kernel is pretty conservative.  Options for AUTO_EOI_1, AUTO_EOI_2,
> HZ, maxusers and so-on can all make a significant difference.

You are right there. I don't use AUTO_EOI_* as this is a laptop and
can't afford to lose the suspend/resume functionality (i'll try it out
though and report after I get some sleep). HZ is set to 1000 and
maxusers to 0 (i.e. auto-config), causing the system to set it to 384
That is:
	$ sysctl kern.maxusers
	kern.maxusers: 384

> Other platforms may ship with a much more aggressive set of defaults.
> You have to control for these things or you're not doing a legitimate
> comparison.

I imagine that, only I'd like to find out what those defaults are and
how they differ from freebsd, and thought that this is the right place
to ask... :)
 
Please note that I don't mean this e-mail (thread) as a "look, freebsd
sucks" thing. After all, I've already said that freebsd _is_ my
OS-of-choice for (at least) development chores. However, such a
performance lag is a show-stopper for me (especially with various
related deadlines approaching fast).

I'm willing to take some days off the actual coding process to hunt this
performance issue down. What I wanted to know is if someone here _knows
for sure_ that, say, HotSpot sucks under FreeBSD compared to linux and
win32.

\n\n



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061111042829.GB88440>