sgup432 commented on code in PR #15124:
URL: https://github.com/apache/lucene/pull/15124#discussion_r2361233254
##########
lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java:
##########
@@ -426,10 +425,8 @@ public void clear() {
}
private static long getRamBytesUsed(Query query) {
- return LINKED_HASHTABLE_RAM_BYTES_PER_ENTRY
- + (query instanceof Accountable accountableQuery
- ? accountableQuery.ramBytesUsed()
- : QUERY_DEFAULT_RAM_BYTES_USED);
+ long queryRamBytesUsed = RamUsageEstimator.sizeOf(query, 0);
+ return LINKED_HASHTABLE_RAM_BYTES_PER_ENTRY + queryRamBytesUsed;
Review Comment:
@benwtrent I have pushed my final changes, let me know how it looks.
On a side note, I am also going to raise a PR soon(based on my idea
[here](https://github.com/apache/lucene/issues/14222)) to refactor query cache
to improve performance by atleast 2-3x :)
--
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]