You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Nikolay Izhikov (Jira)" <ji...@apache.org> on 2025/12/04 08:01:00 UTC
[jira] [Assigned] (IGNITE-27088) BinaryWriter should use internal String#value
[ https://issues.apache.org/jira/browse/IGNITE-27088?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nikolay Izhikov reassigned IGNITE-27088:
----------------------------------------
Assignee: Nikolay Izhikov
> 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
> Assignee: Nikolay Izhikov
> Priority: Major
> Labels: ise
> 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)