lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Busch (JIRA)" <>
Subject [jira] Updated: (LUCENE-431) RAMInputStream without further buffering
Date Tue, 27 Mar 2007 02:33:32 GMT


Michael Busch updated LUCENE-431:

    Attachment: lucene-431.patch

We should fix both, RAMInputStream and RAMOutputStream to subclass IndexInput and IndexOutput
directly. That saves a lot of unnecessary array copies.

I'm attaching a new patch that changes both classes. Unlike Paul's patch this one keeps the
current buffer in a local variable (as Doug suggested). 

All unit tests pass including TestTermVectorsReader. The reason why this test failes in Paul's
patch is that RAMInputStream does not throw an IOException in case EOF is reached.

I did some quick tests in which I used a RAMDirectory to build an index. With this patch the
test runs 170 secs, the old version takes 236 secs, which is an improvement of about 28%.

> RAMInputStream without further buffering
> ----------------------------------------
>                 Key: LUCENE-431
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Store
>    Affects Versions: CVS Nightly - Specify date in submission
>         Environment: Operating System: other
> Platform: Other
>            Reporter: Paul Elschot
>         Assigned To: Michael Busch
>            Priority: Minor
>         Attachments: lucene-431.patch,
> From java-dev, Doug's reply of 12 Sep 2005 
> on Delaying buffer allocation in BufferedIndexInput: 
> Paul Elschot wrote: 
> ... 
> > I noticed that RAMIndexInput extends BufferedIndexInput. 
> > It has all data in buffers already, so why is there another 
> > layer of buffering? 
> No good reason: it's historical. 
> To avoid this either: (a) the BufferedIndexInput API would need to be  
> modified to permit subclasses to supply the buffer; or (b)  
> RAMInputStream could subclass IndexInput directly, using its own  
> buffers.  The latter would probably be simpler. 
> End of quote. 
> I made version (b) of RAMInputStream. 
> Using this RAMInputStream, TestTermVectorsReader failed as the only 
> failing test.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message