[ 
https://issues.apache.org/jira/browse/LUCENE-2824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972968#action_12972968
 ] 

Robert Muir commented on LUCENE-2824:
-------------------------------------

bq. Did you also try to catch out of bounds exceptions instead of doing the 
bounds checks in the current patch?

Paul, how can we do this? In the mmap case we can because the mmap getXXX will 
throw the bufferunderflow
and not actually read anything if there isn't enough bytes.

But in this case I don't see how we can re-arrange the code to safely do this? 
if you know, please let us know as I think this would be better too.


> optimizations for bufferedindexinput
> ------------------------------------
>
>                 Key: LUCENE-2824
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2824
>             Project: Lucene - Java
>          Issue Type: Improvement
>    Affects Versions: 3.1, 4.0
>            Reporter: Robert Muir
>         Attachments: LUCENE-2824.patch
>
>
> along the same lines as LUCENE-2816:
> * the readVInt/readVLong/readShort/readInt/readLong are not optimal here 
> since they defer to readByte. for example this means checking the buffer's 
> bounds per-byte in readVint instead of per-vint.
> * its an easy win to speed this up, even for the vint case: its essentially 
> always faster, the only slower case is 1024 single-byte vints in a row, in 
> this case we would do a single extra bounds check (1025 instead of 1024)

-- 
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to