Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 67021 invoked from network); 5 Oct 2007 06:54:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Oct 2007 06:54:11 -0000 Received: (qmail 49975 invoked by uid 500); 5 Oct 2007 06:54:00 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 49957 invoked by uid 500); 5 Oct 2007 06:54:00 -0000 Mailing-List: contact commits-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 commits@harmony.apache.org Received: (qmail 49948 invoked by uid 99); 5 Oct 2007 06:54:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2007 23:54:00 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Oct 2007 06:54:11 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C04A7714035 for ; Thu, 4 Oct 2007 23:53:50 -0700 (PDT) Message-ID: <3745001.1191567230751.JavaMail.jira@brutus> Date: Thu, 4 Oct 2007 23:53:50 -0700 (PDT) From: "Pavel Ozhdikhin (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-2607) [drlvm][jit][opt][performance] improve optimizer to simplify arithmetic calculations involving loops In-Reply-To: <22269470.1165845864707.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-2607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pavel Ozhdikhin updated HARMONY-2607: ------------------------------------- Attachment: TestInt.java I was too brief in my previous comment. Actually I did several measurements with a slightly changed test, which uses the return value calculated in the loop, and got an interesting reult on Sun JDK 1.6 "-server" mode: C:\users\pozhdikh\jira\Harmony-2607>C:\jdk1.6.0\bin\java.exe -server TestInt 1st run: 0, out = 499999 2nd run: 0, out = 499999 Other JREs can not show such a good result: C:\users\pozhdikh\jira\Harmony-2607>F:\tools\jdk\1.5\win32-bea\bin\java.exe TestInt 1st run: 66861, out = 499999 2nd run: 64392, out = 499999 C:\users\pozhdikh\jira\Harmony-2607>F:\tools\jdk\1.5\win32-bea\bin\java.exe -server TestInt 1st run: 66891, out = 499999 2nd run: 64407, out = 499999 C:\users\pozhdikh\jira\Harmony-2607>C:\jdk1.6.0\bin\java.exe TestInt 1st run: 93829, out = 499999 2nd run: 93845, out = 499999 C:\users\pozhdikh\jira\Harmony-2607>C:\users\pozhdikh\drlvm\trunk\working_vm\build\win_ia32_msvc_release\deploy\jdk\jre\bin\java.exe TestInt 1st run: 11953, out = 499999 2nd run: 11750, out = 499999 C:\users\pozhdikh\jira\Harmony-2607>C:\users\pozhdikh\drlvm\trunk\working_vm\build\win_ia32_msvc_release\deploy\jdk\jre\bin\java.exe -Xem:server TestInt 1st run: 12578, out = 499999 2nd run: 11734, out = 499999 I see 2 ways to achieve a nearly zero execution time: - recognize calculation pattern at compile-time, calculate and substitute the result - cache return value at run-time and substitute it during re-compilation More ideas? BTW, I agree that a dead loop elimination is a good way to optimize silly loops whose result is not used. > [drlvm][jit][opt][performance] improve optimizer to simplify arithmetic calculations involving loops > ---------------------------------------------------------------------------------------------------- > > Key: HARMONY-2607 > URL: https://issues.apache.org/jira/browse/HARMONY-2607 > Project: Harmony > Issue Type: Improvement > Components: DRLVM > Environment: Windows/IA32 > Reporter: Pavel Ozhdikhin > Priority: Minor > Attachments: DoubleTest.java, Test.java, TestInt.java > > > In the attached test arithmetical calculations and loops may be safely eliminated in both methods test1() and test2(). > Indeed , the results below show that JRockit 1.5 can eliminate them - it faster executes the first run and don't spend time at all for a second: > ================================ > JRockit 1.5 results: > >C:\jrockit-jdk1.5.0\bin\java.exe -version > java version "1.5.0" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64) > BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy single > parpar)) > >C:\jrockit-jdk1.5.0\bin\java.exe Test > 1st run: 203 > 2nd run: 0 > ================================ > DRLVM results: > >C:\win_ia32_msvc_release\deploy\jre\bin\java.exe -version > Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable. > java version "1.5.0" > pre-alpha : not complete or compatible > svn = r483842, (Dec 11 2006), Windows/ia32/msvc 1310, release build > http://incubator.apache.org/harmony > C:\win_ia32_msvc_release\deploy\jre\bin\java.exe Test > 1st run: 19734 > 2nd run: 14828 > ================================ > The optimizer should be able to eliminate such code if it does not have ane side-effect. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.