Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F16F2D6F3 for ; Tue, 16 Oct 2012 11:13:04 +0000 (UTC) Received: (qmail 17821 invoked by uid 500); 16 Oct 2012 11:13:04 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 17772 invoked by uid 500); 16 Oct 2012 11:13:04 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 17746 invoked by uid 99); 16 Oct 2012 11:13:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Oct 2012 11:13:04 +0000 Date: Tue, 16 Oct 2012 11:13:04 +0000 (UTC) From: "Gopal V (JIRA)" To: common-issues@hadoop.apache.org Message-ID: <1368542314.50963.1350385984297.JavaMail.jiratomcat@arcas> In-Reply-To: <71510792.41150.1350118984554.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (HADOOP-8926) hadoop.util.PureJavaCrc32 cache hit-ratio is low for static data MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-8926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gopal V updated HADOOP-8926: ---------------------------- Attachment: crc32-faster+readable.patch Rewrite the core loop for readability & turn all loop locals into final variables. Modify the small loop into a switch statement (java tableswitch instruction) > hadoop.util.PureJavaCrc32 cache hit-ratio is low for static data > ---------------------------------------------------------------- > > Key: HADOOP-8926 > URL: https://issues.apache.org/jira/browse/HADOOP-8926 > Project: Hadoop Common > Issue Type: Improvement > Components: util > Affects Versions: 2.0.3-alpha > Environment: Ubuntu 10.10 i386 > Reporter: Gopal V > Assignee: Gopal V > Priority: Trivial > Labels: optimization > Attachments: crc32-faster+readable.patch, crc32-faster+test.patch, pure-crc32-cache-hit.patch > > > While running microbenchmarks for HDFS write codepath, a significant part of the CPU fraction was consumed by the DataChecksum.update(). > The attached patch converts the static arrays in CRC32 into a single linear array for a performance boost in the inner loop. > milli-seconds for 1Gig (16400 loop over a 64kb chunk) > || platform || original || cache-aware || improvement || > | x86 | 3894 | 2304 | 40.83 | > | x86_64 | 2131 | 1826 | 14 | > The performance improvement on x86 is rather larger than the 64bit case, due to the extra register/stack pressure caused by the static arrays. > A closer analysis of the PureJavaCrc32 JIT code shows the following assembly fragment > {code} > 0x40f1e345: mov $0x184,%ecx > 0x40f1e34a: mov 0x4415b560(%ecx),%ecx ;*getstatic T8_5 > ; - PureJavaCrc32::update@95 (line 61) > ; {oop('PureJavaCrc32')} > 0x40f1e350: mov %ecx,0x2c(%esp) > {code} > Basically, the static variables T8_0 through to T8_7 are being spilled to the stack because of register pressure. The x86_64 case has a lower likelihood of such pessimistic JIT code due to the increased number of registers. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira