iverase commented on pull request #2094:
URL: https://github.com/apache/lucene-solr/pull/2094#issuecomment-735732072


   > SegmentInfos certainly cannot know the endianness of the file up-front. 
But for other file formats, we could know this on a per-file-format basis? E.g. 
Lucene86PointsFormat always uses big endian but Lucene90PointsFormat will 
always use little endian?
   
   @jpountz That is true, but what I understand is the files read  by for 
example `CompressingStoredFieldsReader`, they hold versioning in the header?
   
   > So I'd like to see benchmark results before anything is committed.
   
   @rmuir I have created [JMH 
benchmarks](https://github.com/iverase/endianness_benchmark) that read longs 
using BytesBuffer and LongBuffer with different endianness. Results are here:
   
   ```
   Benchmark                          (byteOrder)   Mode  Cnt   Score   Error   
Units
   ReadLongBenchmark.readBytesBuffer           LE  thrpt   25   9.015 ± 0.012  
ops/us
   ReadLongBenchmark.readBytesBuffer           BE  thrpt   25   8.333 ± 0.040  
ops/us
   ReadLongBenchmark.readLongsBuffer           LE  thrpt   25  24.510 ± 0.191  
ops/us
   ReadLongBenchmark.readLongsBuffer           BE  thrpt   25   9.981 ± 0.034  
ops/us
   ```


----------------------------------------------------------------
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