Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 92015 invoked from network); 6 Nov 2007 11:28:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Nov 2007 11:28:28 -0000 Received: (qmail 80308 invoked by uid 500); 6 Nov 2007 11:28:15 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 80288 invoked by uid 500); 6 Nov 2007 11:28:14 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 80279 invoked by uid 99); 6 Nov 2007 11:28:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Nov 2007 03:28:14 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of t.p.ellison@gmail.com designates 209.85.134.191 as permitted sender) Received: from [209.85.134.191] (HELO mu-out-0910.google.com) (209.85.134.191) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Nov 2007 11:28:16 +0000 Received: by mu-out-0910.google.com with SMTP id w8so1952254mue for ; Tue, 06 Nov 2007 03:27:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:x-enigmail-version:content-type:content-transfer-encoding; bh=REBmB4xKRMXpD7906HBbt8DWdkMTB4UuDWqpqRU/Ow4=; b=fu/mfK6cLG0y1D32+3lXQrfRzw9ZNFarQkfpwRTwpz7tjl/KkvzTZLRsAV+MfTTJTEK0oIIXs0TUNLyO9mEM0ClZD4V+uUhdgYt5onJ8EQs5Ai++tntigYtQrtYvZnDyAD09+OzzRH2PQZw15z0jOrYxE+8XLSRTqTMNZnWEe3g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:x-enigmail-version:content-type:content-transfer-encoding; b=OtpI25K/AV+uLGGVQf41baS6pu/G8xQEiqTDK3XOx5s6LZy8oxIG0C8WX3EjSiIqmVyzeX/1P3gcX0WM6Yg5v1PpEF0pzzSVfY3N3fQeoJ1OMZm7ilYHMCx1O8oQ+4/TItuTHPirYq0Jp5ArLDm5+4cCsRvnwgD1W1VJyGoM8oI= Received: by 10.82.114.3 with SMTP id m3mr11134392buc.1194348475193; Tue, 06 Nov 2007 03:27:55 -0800 (PST) Received: from ?192.168.0.2? ( [86.111.176.100]) by mx.google.com with ESMTPS id z33sm9061323ikz.2007.11.06.03.27.53 (version=SSLv3 cipher=RC4-MD5); Tue, 06 Nov 2007 03:27:54 -0800 (PST) Message-ID: <47304FB3.7020306@gmail.com> Date: Tue, 06 Nov 2007 11:27:47 +0000 From: Tim Ellison User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: dev@harmony.apache.org Subject: Re: [perf] Comparative benchmarking References: <472C548F.6030609@gmail.com> <9623c9a50711040630t7fe443b4r6f05895cc166641@mail.gmail.com> <472E052D.2050804@gmail.com> <9623c9a50711050447g1cac56a0jd0d895608c5ac8ab@mail.gmail.com> <472F2438.80707@gmail.com> <0vqmytsh1mw.fsf@gmail.com> In-Reply-To: <0vqmytsh1mw.fsf@gmail.com> X-Enigmail-Version: 0.95.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Egor Pasko wrote: > On the 0x385 day of Apache Harmony Tim Ellison wrote: >> Harmony 5.0 M3 prints >> Result = 6.666661664588418E8 in 1352ms >> IBM 5.0 SR5a prints >> Result = 6.666661664588418E8 in 40ms >> Sun 1.6.0-b105 prints >> Result = 6.666661664588418E8 in 40ms > > Wow, good catching microbenchmark! Tim++ Credit to Xiao-Feng for that, not me. >> Can we squeeze a bit more out of the JIT? > > actually, Math.sqrt() is native and taken from the slow and portable > FDLIBM. I guess that was my point -- I'm making the assumption, given the orders of magnitude difference in time, that we are going through JNI and IBM/Sun are recognizing the method in the JIT compiler and creating code for it directly. > I believe, libc implementation is supposed to be > faster. -ffast-math does not suit us because sqrt() is a part of > IEEE754 standard which is a part of Java (with signalling exception). I defer to you for the compatibility between the hardware instructions and Java standard, but looks like others are doing the 'right thing', or am I making a wrong assumption here? > In fact, NBody multiplies by 1/sqrt(x) function, and this is where > both JIT and native implementation could help. multiplication and > 1/sqrt(x) must be cheaper than sqrt(x) and division, but I am not sure > it would make an IEEE754 compatible solution. ack. Regards, Tim