Moin Moin Michael, for the first issue I have crated LUCENE-1217, and for the second one I have some questions.
if we maintain length and offset internally in Field than we have one, imo, theoretical "legacy performance problem" as we need to create new byte[length] and copy in order to preserve compatibility (users expect this method to return compact array with 0 offset) I am talking about. public byte[] binaryValue(); would that be acceptable, it is very small penalty and there will be a way to avoid it? Anyhow, if one is using public void setValue(byte[] value), it is to be expected that this user allready has a reference to value. This makes this question rather theoretical, no? we could than create new methods, getOffset() getLength() getBinaryValue() that enable full spectrum and replace all uses that expect 0-offset array. ----- Original Message ---- From: Michael McCandless <[EMAIL PROTECTED]> To: java-dev@lucene.apache.org Sent: Wednesday, 5 March, 2008 10:09:26 AM Subject: Re: Ideas to refactor Filed 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___________________________________________________________ Rise to the challenge for Sport Relief with Yahoo! For Good http://uk.promotions.yahoo.com/forgood/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]