You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Ignite TC Bot (Jira)" <ji...@apache.org> on 2026/04/09 09:04:00 UTC

[jira] [Commented] (IGNITE-28473) Concurrent message serialization in NIO workers causes performance degradation

    [ https://issues.apache.org/jira/browse/IGNITE-28473?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18072212#comment-18072212 ] 

Ignite TC Bot commented on IGNITE-28473:
----------------------------------------

{panel:title=Branch: [pull/12985/head] Base: [master] : No blockers found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel}
{panel:title=Branch: [pull/12985/head] Base: [master] : No new tests found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#F7D6C1}{panel}
[TeamCity *--&gt; Run :: All* Results|https://ci2.ignite.apache.org/viewLog.html?buildId=8988757&amp;buildTypeId=IgniteTests24Java8_RunAll]

> Concurrent message serialization in NIO workers causes performance degradation
> ------------------------------------------------------------------------------
>
>                 Key: IGNITE-28473
>                 URL: https://issues.apache.org/jira/browse/IGNITE-28473
>             Project: Ignite
>          Issue Type: Task
>            Reporter: Alex Abashev
>            Assignee: Alex Abashev
>            Priority: Minor
>              Labels: IEP-132, ise
>             Fix For: 2.19
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> When sending the same message to multiple nodes via `GridIoManager.sendToGridTopic()`, the same `Message` object is passed in a loop for each recipient. Serialization does not happen in the sender thread — it happens later, in NIO worker threads (`DirectNioClientWorker.writeToBuffer()` → `GridIoMessageMarshallableSerializer.writeTo()`).
> This results in the same message being serialized **N times concurrently** — once per target node, each time in a separate NIO worker thread — even though the byte representation is identical for all recipients. The result is a performance drop due to redundant serialization work.
> **Call stack:**
>     GridIoMessageMarshallableSerializer.writeTo()
>       → GridNioServer$DirectNioClientWorker.writeToBuffer()
>         → processWrite0() → processWrite()
>           → AbstractNioClientWorker.processSelectedKeysOptimized()
>             → bodyInternal() → body()
> **Expected behavior:** the message should be serialized **once** in the thread where it was constructed, before being enqueued to the NIO layer. NIO workers should operate on a pre-built byte buffer rather than re-serializing the mutable message object independently.
> **Proposed approach:** use the existing serialization mechanism to produce the byte representation of the message once, eagerly, before handing it off to the send queue. NIO workers then write the cached bytes directly to the socket buffer without invoking the serializer.



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