Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4482

"ImmutableBeans.create" has performance issue

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.27.0
    • None

    Description

      We are doing the stressing test, and we found SqlNode#toString's time is unusually high, seems the call is all from SqlNode#toString, we can reduce the useless call of "ImmutableBeans.create" to reduce the time:

      My proposal is to extra default SqlWriterConfig to SqlNode and SqlNode#toString use this static field.

       

        public static final SqlWriterConfig DEFAULT_SQL_WRITER_CONFIG =
            SqlPrettyWriter.config().withDialect(AnsiSqlDialect.DEFAULT)
                .withAlwaysUseParentheses(false)
                .withSelectListItemsOnSeparateLines(false)
                .withUpdateSetListNewline(false)
                .withIndentation(0);
      
      

       
       

      Attachments

        1. image-2021-02-01-15-42-46-942.png
          976 kB
          Jiatao Tao
        2. image-2021-02-01-15-45-11-863.png
          929 kB
          Jiatao Tao
        3. image-2021-02-01-15-46-08-056.png
          973 kB
          Jiatao Tao
        4. image-2021-02-01-15-47-31-577.png
          1.03 MB
          Jiatao Tao
        5. image-2021-02-01-20-52-54-892.png
          291 kB
          Jiatao Tao
        6. image-2021-02-04-15-54-36-417.png
          1.05 MB
          Jiatao Tao

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Aron.tao Jiatao Tao
            Aron.tao Jiatao Tao
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h 20m
                2h 20m

                Slack

                  Issue deployment