viliam-durina opened a new pull request, #15597:
URL: https://github.com/apache/lucene/pull/15597

   Saves 4 bytes pre instance. We have one instance for every node and every 
level, so for a 1 million-node graph, we might save 5-6MB of heap memory.
   
   In fact, `BASE_RAM_BYTES_USED` went from 48 to 40 bytes thanks to 8-byte 
object size alignment, so the saving is double.
   
   A lot more can be done to reduce memory here, e.g. by:
   - removing `onHeapMemoryUsageListener` and passing an instance to 
`addInOrder` and `addOutOfOrder` (easy, saves 4 bytes)
   - removing `size` and using the `nodes.size()` instead (easy, saves 4 bytes)
   - use `int[]` and `float[]` directly instead of `MaxSizedIntArrayList` and 
`MaxSizedFloatArrayList` (bit harder, saves 40 bytes)
   - separating the in-order and out-of-order cases into subclasses: saves 5 
bytes for the in-order case and 1 byte for the out-of-order case.
   
   LMK if you're interested in these changes, esp. the 3rd one.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to