Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 30530 invoked from network); 8 Jul 2008 17:44:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Jul 2008 17:44:10 -0000 Received: (qmail 58943 invoked by uid 500); 8 Jul 2008 17:44:10 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 58408 invoked by uid 500); 8 Jul 2008 17:44:09 -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 58397 invoked by uid 99); 8 Jul 2008 17:44:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jul 2008 10:44:09 -0700 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 aleksey.shipilev@gmail.com designates 209.85.198.244 as permitted sender) Received: from [209.85.198.244] (HELO rv-out-0708.google.com) (209.85.198.244) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jul 2008 17:43:18 +0000 Received: by rv-out-0708.google.com with SMTP id k29so2711606rvb.0 for ; Tue, 08 Jul 2008 10:43:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=kHmQCpXcl1MSVeZEnoUmcWoav/a1I4zg6rBdbbALO0E=; b=FeZO+7vAB+TEUQCn0Gio1MrBw9lYCtn7fa7CmofsEySttlOniOmlWozGcOr7oAgV09 CLthij4jwo4SvYFHxgHyW667aISMj/qfieoKAoyIzGx/yzNIfddDypBJj/bnRoPMhUvS 9qPwe/d37yGsBqBayJcdBGRdEukPj4W28HC0o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=PDtBzuo2IXBADjq/EAp3C1nIH+9Ra5moP5tp6/eZUhPo05r+547wkRn74Yn0qBKAZX i/0D7NsACILRfd75WgIRTTh745Q1qzVoGIsNGIsXLaBX7byl4UOQoecZmpjwtN1D7M8p rVP+WoR4rCcM5WCm/v7wLKT9cQRRBr68h/ufQ= Received: by 10.140.127.20 with SMTP id z20mr3370874rvc.77.1215539019977; Tue, 08 Jul 2008 10:43:39 -0700 (PDT) Received: by 10.141.51.9 with HTTP; Tue, 8 Jul 2008 10:43:39 -0700 (PDT) Message-ID: <4bebff790807081043g4d42c754q53ff0006d2a170bf@mail.gmail.com> Date: Tue, 8 Jul 2008 21:43:39 +0400 From: "Aleksey Shipilev" To: dev@harmony.apache.org Subject: [classlib][pack200][performance] Profiling unpacking scenario MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org Hi, I took the liberty of profiling of pack200 implementation on unpacking scenario. Source data was obtained from Eclipse JDT jars, repacked in single 60 Mb jar file, then packed with pack200 from Sun's JDK (-E9 used), resulting in 20 Mb pack200-compressed file. Then Sun JDK 1.6.0_05 (Windows, -server) was used together with hprof (cpu=time) to obtain the profile. My patch from HARMONY-5900 is onboard. The head of the profile looks like this: 4.76% org.apache.harmony.unpack200.bytecode.ClassConstantPool.addNested 4.22% java.util.HashMap.getEntry 2.99% java.util.AbstractList$Itr.next 2.92% java.util.AbstractList$Itr.hasNext 2.84% java.util.ArrayList.get 2.43% java.util.AbstractList$Itr.next 2.41% java.util.HashMap.containsKey 2.15% org.apache.harmony.unpack200.IcBands.getRelevantIcTuples 2.00% java.util.HashSet.contains 1.57% java.io.DataOutputStream.writeUTF Composite occupancy: 18.4% java.util.AbstractList 18.0% java.util.HashMap 15.8% java.util.ArrayList 10.5% o.a.h.unpack200.bytecode.ClassConstantPool.* 5.3% o.a.h.unpack200.bytecode.CPUTF8.* (hashcode mostly) 4.5% java.io.* 4.5% java.lang.String.* 4.4% o.a.h.unpack200.bytecode.ByteCode.* 3.9% o.a.h.unpack200.bytecode.Ic{Tuple|Bands}.* 14.7% other So the main concern is Collections usage. ClassConstantPool uses Lists excessively, so I suspect the significant amount of time is spent there. NB: Timings for the scenario (the less the better): Harmony's pack200: 67 secs Sun's pack200: 6 secs Yep, 10 times faster. Thanks, Aleksey.