You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jiatao Tao (Jira)" <ji...@apache.org> on 2021/04/11 12:54:00 UTC

[jira] [Updated] (CALCITE-4577) RelDigestWriter#done has performance issue when node's inputs is large

     [ https://issues.apache.org/jira/browse/CALCITE-4577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jiatao Tao updated CALCITE-4577:
--------------------------------
    Summary: RelDigestWriter#done has performance issue when node's inputs is large  (was: RelDigestWriter#done has performance issu when node's inputs is large)

> RelDigestWriter#done has performance issue when node's inputs is large
> ----------------------------------------------------------------------
>
>                 Key: CALCITE-4577
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4577
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Jiatao Tao
>            Assignee: Jiatao Tao
>            Priority: Critical
>         Attachments: image-2021-04-11-16-53-35-466.png, image-2021-04-11-16-53-58-757.png
>
>
> Example like that: insert xxx VALUES (1, 'one'), (2, 'two'), (3, 'three')...(10000, 'ten thousand');
> It generates a Union node with 10000 inputs, and the performance is poor, here's the profile:
>  
> !image-2021-04-11-16-53-58-757.png|width=735,height=109!
> A point that affects performance is the array copy of StringBuilder, current we just new StringBuilder with default capacity, my proposal is to consider the node's input size, like that(we can discuss the strategy):
> org.apache.calcite.rel.AbstractRelNode.RelDigestWriter#done
> {code:java}
>       StringBuilder sb = new StringBuilder((values.size() + 1) * 16);{code}
> It's about 20% performance improvement and mem is more smooth.
>   



--
This message was sent by Atlassian Jira
(v8.3.4#803005)