LazyField retains temp char[] buffer

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

LazyField retains temp char[] buffer

Yonik Seeley-2
While reviewing some of the LazyField code in preparation for Solr support,
https://issues.apache.org/jira/browse/SOLR-52
I noticed that the char[] used to read the String data is a member,
and thus kept around after the data is read and a String constructed.
It doesn't look like it serves any purpose... I assume this is just a
little oversight?

-Yonik
http://incubator.apache.org/solr Solr, the open-source Lucene search server

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: LazyField retains temp char[] buffer

Nicolas Lalevée-2
Le Samedi 07 Octobre 2006 18:29, Yonik Seeley a écrit :
> While reviewing some of the LazyField code in preparation for Solr support,
> https://issues.apache.org/jira/browse/SOLR-52
> I noticed that the char[] used to read the String data is a member,
> and thus kept around after the data is read and a String constructed.
> It doesn't look like it serves any purpose... I assume this is just a
> little oversight?

It looks like to me that this was designed to avoid many instanciation of
char[] buffers. So I wouldssay that this would be static, but then you will
certainly have concurrency problems.

Maybe you can be interested in the way I worked with it in LUCENE-662.

Nicolas

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: LazyField retains temp char[] buffer

Grant Ingersoll
In reply to this post by Yonik Seeley-2
I think I was modeling it after IndexInput which does a similar thing  
when reading in String data to avoid having to reallocate the buffer  
unless it is necessary.  But you're right, in looking at it now,  
there really is no need for it since the LazyField is instantiated  
each time it is read in.



On Oct 7, 2006, at 12:29 PM, Yonik Seeley wrote:

> While reviewing some of the LazyField code in preparation for Solr  
> support,
> https://issues.apache.org/jira/browse/SOLR-52
> I noticed that the char[] used to read the String data is a member,
> and thus kept around after the data is read and a String constructed.
> It doesn't look like it serves any purpose... I assume this is just a
> little oversight?
>
> -Yonik
> http://incubator.apache.org/solr Solr, the open-source Lucene  
> search server
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

--------------------------
Grant Ingersoll
Sr. Software Engineer
Center for Natural Language Processing
Syracuse University
335 Hinds Hall
Syracuse, NY 13244
http://www.cnlp.org

Voice: 315-443-5484
Skype: grant_ingersoll
Fax: 315-443-6886




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: LazyField retains temp char[] buffer

Yonik Seeley-2
On 10/8/06, Grant Ingersoll <[hidden email]> wrote:
> I think I was modeling it after IndexInput which does a similar thing
> when reading in String data to avoid having to reallocate the buffer
> unless it is necessary.  But you're right, in looking at it now,
> there really is no need for it since the LazyField is instantiated
> each time it is read in.

Thanks for the confirmation, I just checked in a fix for this.


-Yonik
http://incubator.apache.org/solr Solr, the open-source Lucene search server


> On Oct 7, 2006, at 12:29 PM, Yonik Seeley wrote:
>
> > While reviewing some of the LazyField code in preparation for Solr
> > support,
> > https://issues.apache.org/jira/browse/SOLR-52
> > I noticed that the char[] used to read the String data is a member,
> > and thus kept around after the data is read and a String constructed.
> > It doesn't look like it serves any purpose... I assume this is just a
> > little oversight?

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]