Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 72844 invoked from network); 23 Feb 2008 02:38:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Feb 2008 02:38:05 -0000 Received: (qmail 50542 invoked by uid 500); 23 Feb 2008 02:37:59 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 49874 invoked by uid 500); 23 Feb 2008 02:37:58 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 49811 invoked by uid 99); 23 Feb 2008 02:37:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2008 18:37:58 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Feb 2008 02:37:19 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 61FA9234C010 for ; Fri, 22 Feb 2008 18:37:19 -0800 (PST) Message-ID: <998733945.1203734239400.JavaMail.jira@brutus> Date: Fri, 22 Feb 2008 18:37:19 -0800 (PST) From: "Michael Busch (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Resolved: (LUCENE-1185) [PATCH] Avoid checking for TermBuffer in SegmentTermEnum#scanTo In-Reply-To: <148381134.1203675979439.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-1185?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Busch resolved LUCENE-1185. ----------------------------------- Resolution: Fixed Fix Version/s: 2.4 Lucene Fields: [New, Patch Available] (was: [Patch Available, New]) Committed. Thanks Christian! > [PATCH] Avoid checking for TermBuffer in SegmentTermEnum#scanTo > --------------------------------------------------------------- > > Key: LUCENE-1185 > URL: https://issues.apache.org/jira/browse/LUCENE-1185 > Project: Lucene - Java > Issue Type: Improvement > Components: Index > Affects Versions: 2.3, 2.3.1, 2.4 > Environment: any > Reporter: Christian Kohlsch=C3=BCtter > Fix For: 2.4 > > Attachments: LUCENE-1185-SegmentTermEnum.patch > > > It seems that SegmentTermEnum#scanTo is a critical method which is called= very often, especially whenever we iterate over a sequence of terms in an = index. > When that method is called, the first thing happens is that it checks whe= ther a temporary TermBuffer "scratch" has already been initialized. > In fact, this is not necessary. We can simply declare and initialize the = "scratch"-Buffer at the class-level (right now, the initial value is _null_= ). Java's lazy-loading capabilities allow this without adding any memory fo= otprint for cases where we do not need that buffer. > The attached patch takes care of this. We now save one comparison per ter= m. > In addition to that, the patch renames "scratch" to "scanBuffer", which a= ligns with the naming of the other two buffers that are declared in the cla= ss. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org