msfroh commented on PR #13543:
URL: https://github.com/apache/lucene/pull/13543#issuecomment-2299646044

   I was just looking at a flame graph for an indexing performance regression 
with JDK21 and noticed a lot of time spent in 
`BufferedOutputStream#growIfNeeded`. Without virtual threads, it looks like 
`growIfNeeded` (uselessly) does an addition and two comparisons, which doesn't 
sound like much, but may add up when `BufferedOutputStream#write(int)` is 
called a bajillion times.
   
   This change should also help with that by cutting the number of calls to 
`BufferedOutputStream#write(int)` by a factor of 8192, which cuts the number of 
calls to `growIfNeeded` by the same factor.
   
   Of course, if it followed the same pattern as 
`writeShort`/`writeInt`/`writeLong`, we could eliminate calls to `growIfNeeded` 
altogether.


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