From owner-freebsd-java@FreeBSD.ORG Sat Nov 11 04:46:45 2006 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3937B16A415 for ; Sat, 11 Nov 2006 04:46:45 +0000 (UTC) (envelope-from ntarmos@ceid.upatras.gr) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id 00AC943D49 for ; Sat, 11 Nov 2006 04:46:43 +0000 (GMT) (envelope-from ntarmos@ceid.upatras.gr) Received: from rhea.ceid.upatras.gr (rhea.ceid.upatras.gr [150.140.141.171]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id 08CC25C1B0F for ; Sat, 11 Nov 2006 06:46:43 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by rhea.ceid.upatras.gr (Postfix) with ESMTP id F275280007 for ; Sat, 11 Nov 2006 06:46:40 +0200 (EET) Received: from rhea.ceid.upatras.gr ([127.0.0.1]) by localhost (rhea [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 03648-01 for ; Sat, 11 Nov 2006 06:46:38 +0200 (EET) Received: from ace.b020.ceid.upatras.gr (unknown [150.140.143.234]) by rhea.ceid.upatras.gr (Postfix) with ESMTP id D2FEE80002 for ; Sat, 11 Nov 2006 06:46:37 +0200 (EET) Received: by ace.b020.ceid.upatras.gr (Postfix, from userid 1001) id 2FC2756; Sat, 11 Nov 2006 06:28:29 +0200 (EET) Date: Sat, 11 Nov 2006 06:28:29 +0200 From: Nikos Ntarmos To: freebsd-java@freebsd.org Message-ID: <20061111042829.GB88440@ace.b020.ceid.upatras.gr> Mail-Followup-To: freebsd-java@freebsd.org References: <20061110203714.GA89006@ace.b020.ceid.upatras.gr> <20061110124459.M88944@turing> <20061110213313.GA72658@ace.b020.ceid.upatras.gr> <20061110142436.G88944@turing> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061110142436.G88944@turing> Organization: NetCInS Lab., C.E.I.D., U. of Patras, Greece WWW-Homepage: http://ntarmos.dyndns.org/ X-PGP-Fingerprint: 9680 60A7 DE60 0298 B1F0 9B22 9BA2 7569 CF95 160A Office-Phone: +30-2610-996919 Office-Fax: +30-2610-969011 GPS-Info: 38.31N, 21.82E User-Agent: mutt-ng/devel-r804 (FreeBSD) X-Virus-Scanned: by amavisd-new at ceid.upatras.gr Subject: Re: Performance of Java on FBSD vs. others... X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2006 04:46:45 -0000 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