Maksim Timonin created IGNITE-27088:
---------------------------------------

             Summary: BinaryWriter should use internal String#value 
                 Key: IGNITE-27088
                 URL: https://issues.apache.org/jira/browse/IGNITE-27088
             Project: Ignite
          Issue Type: Improvement
            Reporter: Maksim Timonin
         Attachments: WritingBigMapReproducer.java

While writing Strings in BinaryWriter we call BinaryWriterExImpl#writeString, 
that calls String#getBytes. 

Last call creates a copy of internal String#value byte array. Java does it 
intentionally, to avoid scenario when this array will be changed. 

But writing a lot of strings leads to useless heap usage for creating such 
copies. Actually we can get this array using Unsafe/Reflection to optimize 
String writings.

This change should be done carefully, because String.getBytes also provides 
encoding, and this behavior must be taken into account.

Example of writeString/writeByteArray in attach



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to