Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 95546 invoked from network); 8 Sep 2005 22:34:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Sep 2005 22:34:32 -0000 Received: (qmail 82852 invoked by uid 500); 8 Sep 2005 22:34:29 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 82833 invoked by uid 500); 8 Sep 2005 22:34:29 -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 82820 invoked by uid 99); 8 Sep 2005 22:34:28 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Sep 2005 15:34:28 -0700 X-ASF-Spam-Status: No, hits=1.7 required=10.0 tests=RCVD_IN_NJABL_DUL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [207.115.57.60] (HELO ylpvm29.prodigy.net) (207.115.57.60) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Sep 2005 15:34:39 -0700 Received: from pimout3-ext.prodigy.net (pimout3-int.prodigy.net [207.115.4.218]) by ylpvm29.prodigy.net (8.12.10 outbound/8.12.10) with ESMTP id j88MY7bU010126 for ; Thu, 8 Sep 2005 18:34:10 -0400 X-ORBL: [63.202.20.2] Received: from [192.168.168.81] (adsl-63-202-20-2.dsl.snfc21.pacbell.net [63.202.20.2]) by pimout3-ext.prodigy.net (8.13.4 outbound domainkey aix/8.13.4) with ESMTP id j88MYCA2420220; Thu, 8 Sep 2005 18:34:17 -0400 Message-ID: <4320BC64.5060003@apache.org> Date: Thu, 08 Sep 2005 15:34:12 -0700 From: Doug Cutting User-Agent: Mozilla Thunderbird 1.0.6-1.1.fc3 (X11/20050720) X-Accept-Language: en-us, en MIME-Version: 1.0 To: java-dev@lucene.apache.org Subject: Re: Uneffective writeBytes and readBytes [FIX] References: <20050906112407.60110b10.lukas.zapletal@qcm.cz> <20050906131502.4865f025.lukas.zapletal@qcm.cz> <4320AA85.2090304@apache.org> <200509082332.49230.paul.elschot@xs4all.nl> In-Reply-To: <200509082332.49230.paul.elschot@xs4all.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Paul Elschot wrote: > I suppose one of these cases are when many terms are used in a query. > Would it be easily possible to make the buffer size for a term iterator > depend on the numbers of documents to be iterated? > Many terms only occur in a few documents, so this could be a > nice win on total buffer size for the many terms case. This would not be too difficult. Look in SegmentTermDocs.java. The buffer may be allocated when the parent's stream is first cloned, but clone() won't allocate a buffer if the source hasn't had a buffer allocated yet, and nothing should perform i/o directly on the parent's freqStream, so in practice a buffer should not be allocated until the first read is performed on the clone. So one could add an BufferedIndexInput.setBufferSize() method and then call it in SegmentTermDocs.seek(TermInfo), when the df is known and a buffer has not yet been allocated. Doug --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org