From java-dev-return-24630-apmail-lucene-java-dev-archive=lucene.apache.org@lucene.apache.org Wed Mar 05 09:09:52 2008 Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 94243 invoked from network); 5 Mar 2008 09:09:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Mar 2008 09:09:52 -0000 Received: (qmail 55502 invoked by uid 500); 5 Mar 2008 09:09:47 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 55032 invoked by uid 500); 5 Mar 2008 09:09:46 -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 55021 invoked by uid 99); 5 Mar 2008 09:09:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Mar 2008 01:09:46 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [72.14.246.243] (HELO ag-out-0708.google.com) (72.14.246.243) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Mar 2008 09:09:10 +0000 Received: by ag-out-0708.google.com with SMTP id 35so1724532aga.11 for ; Wed, 05 Mar 2008 01:09:19 -0800 (PST) Received: by 10.100.163.8 with SMTP id l8mr6299833ane.56.1204708159613; Wed, 05 Mar 2008 01:09:19 -0800 (PST) Received: from ?10.17.4.4? ( [72.93.214.93]) by mx.google.com with ESMTPS id 8sm864999wrl.21.2008.03.05.01.09.18 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 05 Mar 2008 01:09:18 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v753) In-Reply-To: <186841.75529.qm@web23013.mail.ird.yahoo.com> References: <186841.75529.qm@web23013.mail.ird.yahoo.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Michael McCandless Subject: Re: Ideas to refactor Filed Date: Wed, 5 Mar 2008 04:09:26 -0500 To: java-dev@lucene.apache.org X-Mailer: Apple Mail (2.753) X-Virus-Checked: Checked by ClamAV on apache.org Good morning! eks dev wrote: > I have noticed the two potential enhancements in Field, and I am > not sure if I read it correctly, so better to ask before crating > Jira issue :) > > 1.. Field uses two methods to determine type of fieldsData, > sometimes with boolean isBinary; and sometimes with instanceof byt[] > The proposal is to reduce it to one method, ether by removing > isBinary and using instance of byte[] or to replace one instanceof > with isBinary. I do not know which one should be faster? This makes sense. Is this for the binaryValue() method? I would expect the explicit isBinary would be fastest. > 2. Second enhancement would be to add length of char[]/byte[], to > setValue(...) methods e.g. > public void setValue(byte[] value, int length) //maybe offset as > well? > This would enable users to save some allocations This also makes sense. I think adding offset and length makes sense. Mike --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org