[GitHub] [lucene-solr] jpountz commented on a change in pull request #1031: LUCENE-9059: Reduce garbage created by ByteBuffersDataOutput.
jpountz commented on a change in pull request #1031: LUCENE-9059: Reduce garbage created by ByteBuffersDataOutput. URL: https://github.com/apache/lucene-solr/pull/1031#discussion_r350649834 ## File path: lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataOutput.java ## @@ -412,7 +413,11 @@ public long ramBytesUsed() { * lead to hard-to-debug issues, use with great care. */ public void reset() { -blocks.stream().forEach(blockReuse); +if (blockReuse != NO_REUSE) { Review comment: Good point, I'll change it to `blocks.forEach(blockReuse)`. 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 With regards, Apache Git Services - To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org
[GitHub] [lucene-solr] jpountz commented on a change in pull request #1031: LUCENE-9059: Reduce garbage created by ByteBuffersDataOutput.
jpountz commented on a change in pull request #1031: LUCENE-9059: Reduce garbage created by ByteBuffersDataOutput. URL: https://github.com/apache/lucene-solr/pull/1031#discussion_r349741552 ## File path: lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataOutput.java ## @@ -279,11 +279,12 @@ public ByteBuffersDataInput toDataInput() { * Copy the current content of this object into another {@link DataOutput}. */ public void copyTo(DataOutput output) throws IOException { -for (ByteBuffer bb : toBufferList()) { +for (ByteBuffer bb : blocks) { if (bb.hasArray()) { Review comment: this condition was always `false` before because toBufferList calls `asReadOnlyBuffer` on the buffers 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 With regards, Apache Git Services - To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org
[GitHub] [lucene-solr] jpountz commented on a change in pull request #1031: LUCENE-9059: Reduce garbage created by ByteBuffersDataOutput.
jpountz commented on a change in pull request #1031: LUCENE-9059: Reduce garbage created by ByteBuffersDataOutput. URL: https://github.com/apache/lucene-solr/pull/1031#discussion_r349741288 ## File path: lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataOutput.java ## @@ -412,7 +413,11 @@ public long ramBytesUsed() { * lead to hard-to-debug issues, use with great care. */ public void reset() { -blocks.stream().forEach(blockReuse); +if (blockReuse != NO_REUSE) { Review comment: This check isn't related to what I saw in the profile, though it looks like it could be an easy win in some cases. The important change is the move from `forEach` to a `for` loop. 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 With regards, Apache Git Services - To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org