Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 12564 invoked from network); 15 Nov 2007 22:22:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Nov 2007 22:22:04 -0000 Received: (qmail 93905 invoked by uid 500); 15 Nov 2007 22:21:52 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 93883 invoked by uid 500); 15 Nov 2007 22:21:52 -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 93874 invoked by uid 99); 15 Nov 2007 22:21:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Nov 2007 14:21:52 -0800 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; Thu, 15 Nov 2007 22:21:50 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0CBCA71422B for ; Thu, 15 Nov 2007 14:21:43 -0800 (PST) Message-ID: <19526767.1195165303025.JavaMail.jira@brutus> Date: Thu, 15 Nov 2007 14:21:43 -0800 (PST) From: "Maksim Ananjev (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-5090) [drlvm][jit][opt]operator strength reduction In-Reply-To: <5459257.1194502250557.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-5090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12542902 ] Maksim Ananjev commented on HARMONY-5090: ----------------------------------------- I used this: public static void test(){ Stopwatch sw = new Stopwatch(); int sum = 0; int bigsum = 0; sw.start(); for(int j=0; j<100000; j++){ for (int i=0; i<100000; i++){ i++; int temp = 10*i; sum +=temp; } bigsum+=sum; } double time = sw.read(); System.out.println(bigsum); System.out.println(time); } The boost is 2x -4x depending on underlying system and hardware. > [drlvm][jit][opt]operator strength reduction > -------------------------------------------- > > Key: HARMONY-5090 > URL: https://issues.apache.org/jira/browse/HARMONY-5090 > Project: Harmony > Issue Type: New Feature > Components: DRLVM > Environment: Hope it works everywhere > Reporter: Maksim Ananjev > Priority: Minor > Attachments: HARMONY-5090.patch > > > Operator Strength Reduction is an optimization that reformulates costly operations in terms of less expensive ones. > The simplest possible example is the following: > before: > int sum = 0; > for(int i=0; i<10;i++){ > int temp = i * 10; > sum+=temp > } > after: > int sum = 0; > for(int j=0; j<100; j+=10){ > sum+=j > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.