JDK-8224212 : stringStream::as_string() is inefficient
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 13
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2019-05-20
  • Updated: 2021-01-07
  • Resolved: 2021-01-07
Related Reports
Relates :  
Relates :  
Relates :  
Description
stringStream::as_string() creates a copy of the backing memory inside the stream to return the printout to the caller. 

stringStream's internal buffer already contains the printed string and it is guaranteed to be zero terminated. So in a large number of places using this buffer directly instead of calling stringStream::as_string() is more efficient. 
Comments
Runtime Triage: This is not on our current list of priorities. We will consider this feature if we receive additional customer requirements.
07-01-2021