uschindler commented on PR #912: URL: https://github.com/apache/lucene/pull/912#issuecomment-1314033529
It does not fully explain it, because actually the copy of memory between file and heap is both using `Unsafe#copyMemory`. The only difference is that for ByteBuffer there is some hardcoded limit of 8 or 16 bytes (not exactly sure, have to look it up). If the byte[] not larger than it uses a copy-loop. In future it would be great if Panama would provide a method in `OutputStream` like `stream.writeBytes(MemorySegment segment, long offset, long count)`. This would allow to not copy at all and use a `dd` like approach. We could then add IndexInput#copyTo to our API. I think we worked on something similar, but for copying a complete off-heap approch would be best. -- 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. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org 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