IGNITE-27088 BinaryWriter should use internal String#value - #13529
Open
nizhikov wants to merge 9 commits into
Open
IGNITE-27088 BinaryWriter should use internal String#value#13529nizhikov wants to merge 9 commits into
nizhikov wants to merge 9 commits into
Conversation
nizhikov
force-pushed
the
IGNITE-27088
branch
from
September 4, 2026 14:36
75b0200 to
ccb6f14
Compare
Contributor
TCBot Test Analysis
Possible Blockers (0)No blockers found. New Tests (4)
|
There was a problem hiding this comment.
🟡 Changes recommended
A Checkstyle-enforced unused import in StringWriter.java will break the build, and the JMH benchmark’s zeroCopy parameterization is not reliable due to JVM-static initialization of the toggle.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Introduces a zero-copy UTF-8 string serialization path for Ignite binary writing, controlled by a new system property, and adds tests/benchmarks to validate and measure the behavior.
Changes:
- Added
StringWriterto serializeStringtoBinaryOutputStreamwithout allocating temporary UTF-8 byte arrays when enabled. - Added
IGNITE_BINARY_STRING_ZERO_COPYsystem property (defaulttrue) and wired it intoBinaryWriterExImpl. - Updated
DirectByteBufferStreamstring encoding/decoding to be explicitly UTF-8 and added coverage/benchmarking for the new string writer.
File summaries
| File | Description |
|---|---|
| modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsTestSuite.java | Adds the new StringWriterSelfTest to the binary objects test suite. |
| modules/core/src/test/java/org/apache/ignite/internal/binary/StringWriterSelfTest.java | New differential tests ensuring StringWriter output matches UTF-8 String#getBytes serialization. |
| modules/core/src/main/java/org/apache/ignite/internal/direct/stream/DirectByteBufferStream.java | Uses UTF-8 explicitly for string serialization; adds ASCII fast-path via internal string value. |
| modules/commons/src/main/java/org/apache/ignite/IgniteCommonsSystemProperties.java | Adds IGNITE_BINARY_STRING_ZERO_COPY property and default value constant. |
| modules/binary/impl/src/main/java/org/apache/ignite/internal/binary/StringWriter.java | New zero-copy UTF-8 string writer with compact-string and SIMD-negative-scan optimizations when available. |
| modules/binary/impl/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java | Enables StringWriter path when IGNITE_BINARY_STRING_ZERO_COPY is enabled. |
| modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/binary/JmhBinaryStringWriteBenchmark.java | Adds JMH benchmark intended to compare zero-copy vs legacy behavior. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+84
to
+88
| @Setup | ||
| public void setup() { | ||
| // Must be set before the first use of StringWriter in this JVM. | ||
| System.setProperty(IGNITE_BINARY_STRING_ZERO_COPY, String.valueOf(zeroCopy)); | ||
|
|
Comment on lines
+29
to
+32
| /** | ||
| * Tests that {@link StringWriter} output is byte-identical to serialization of the {@link String#getBytes()} result, | ||
| * which was used before zero-copy string serialization was introduced. | ||
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
The Contribution Checklist
The description explains WHAT and WHY was made instead of HOW.
The following pattern must be used:
IGNITE-XXXX Change summarywhereXXXX- number of JIRA issue.(see the Maintainers list)
the
green visaattached to the JIRA ticket (see tabPR Checkat TC.Bot - Instance 1 or TC.Bot - Instance 2)Notes
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.