On Dec 20, 2007 10:07 AM, Grant Ingersoll <[EMAIL PROTECTED]> wrote: > Hmmm, I will have to take a look at Token.clone. I must admit I don't > know a lot about the perf. differences between clone and new, but I > would think the cost should be on par, if not a little cheaper, > otherwise what's the point?
> It also seems like we shouldn't have to > go through nulling out/reinitialization of the term buffer, since we > already know the size, etc. of the term buffer. I assume you are referring to this part of the clone code()? if (termBuffer != null) { t.termBuffer = null; t.setTermBuffer(termBuffer, 0, termLength); } The nulling out was just so that setTermBuffer() code could be re-used. I bet most of the cost in cloning is due to the native clone() call. It looks like maybe we should replace that with new Token().... the slight downside being that it no longer works the same way if someone subclasses Token. -Yonik --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]