mikemccand commented on PR #12624:
URL: https://github.com/apache/lucene/pull/12624#issuecomment-1828548480

   Hmm I'm running `Test2BFSTs` on this patch and noticed it seems to take very 
much longer during the `TEST: now verify` step where it confirms the built FST 
accepts all the inputs it just compiled into it.
   
   I `jstack`'d it and found this:
   
   ```
      java.lang.Thread.State: RUNNABLE
           at 
java.nio.ByteBuffer.position(java.base@17.0.9/ByteBuffer.java:1516)
           at java.nio.ByteBuffer.position(java.base@17.0.9/ByteBuffer.java:267)
           at java.nio.Buffer.<init>(java.base@17.0.9/Buffer.java:246)
           at java.nio.ByteBuffer.<init>(java.base@17.0.9/ByteBuffer.java:288)
           at 
java.nio.HeapByteBuffer.<init>(java.base@17.0.9/HeapByteBuffer.java:95)
           at 
java.nio.HeapByteBufferR.<init>(java.base@17.0.9/HeapByteBufferR.java:102)
           at 
java.nio.HeapByteBufferR.duplicate(java.base@17.0.9/HeapByteBufferR.java:135)
           at 
java.nio.HeapByteBufferR.asReadOnlyBuffer(java.base@17.0.9/HeapByteBufferR.java:148)
           at 
org.apache.lucene.store.ByteBuffersDataInput.<init>(ByteBuffersDataInput.java:60)
           at 
org.apache.lucene.store.ByteBuffersDataOutput.toDataInput(ByteBuffersDataOutput.java:279)
           at 
org.apache.lucene.util.fst.ReadWriteDataOutput.getReverseBytesReader(ReadWriteDataOutput.java:52)
           at org.apache.lucene.util.fst.FST.getBytesReader(FST.java:1181)
           at org.apache.lucene.util.fst.Util.get(Util.java:50)
           at org.apache.lucene.util.fst.Test2BFST.test(Test2BFST.java:113)
   ```
   
   It looks like getting the reversed reader has maybe become quite a bit more 
expensive than `BytesStore` was?
   
   Note that `Test2BFSTs` is quite silly -- it uses `Util.get` for every 
lookup, instead of pulling and reusing a `ReverseBytesReader` like most "real" 
usages of FST (e.g. terms dict) will do.  So perhaps this performance change 
doesn't really matter in practice?  Though I wonder if all consumers of FST are 
re-using their reversed readers?


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

Reply via email to