uschindler commented on pull request #2176:
URL: https://github.com/apache/lucene-solr/pull/2176#issuecomment-754302399


   > No, the floats are read using readBytes() into a ByteBuffer and then 
converted using a derived FloatBuffer. So I think your intuition about 
readBytes() is correct?
   
   Huh? Really. I thought you are using the code in readLELongs default 
implementation on IndexInput. So you also copy stuff 2 times! That's even 
worse, it would have been better to the ByteBuffer directly from IndexInput: 
`curSegment.slice(offset, length).asByteBuffer()` would return a view on the 
bytes. Or alternatively do it like with readLELongs().
   
   But nevertheless, for readBytes the wrapping is extensive and may be a 
slowdown. Can you try this again using a loop of 
`Float.intBitsToFloat(input.readInt())`? If this is faster I would say that my 
first expectation is correct: If the number of integers or single bytes to read 
is small (maybe <50 or <100) then it might really be better to just have a loop 
calling readByte() or readLong() instead of the array views.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to