Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-151

performance degraded after upgrading from 1.1.7 to 1.1.8

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 1.1.8
    • 1.1.9
    • Other
    • None
    • Linux

    Description

      After upgrading from 1.1.7 to 1.1.8, I noticed a performance decrease. The CPU Sampler in VisualVM pointed to MySQLParameterizedQuery.toSQL2() being the issue.

      I modified this method to use a StringBuilder instead of += which seems to have addressed the issue.

      Updated Code:

      private String toSQL2() throws UnsupportedEncodingException {
      if(queryPartsArray.length == 0)

      { return ""; }

      StringBuilder sb = new StringBuilder(new String(queryPartsArray[0], "UTF-8"));

      for(int i = 1; i<queryPartsArray.length; i++)

      { sb.append(parameters[i-1]); if(queryPartsArray[i].length != 0) sb.append(new String(queryPartsArray[i], "UTF-8")); }

      return sb.toString();
      }

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            afrazier Alan Frazier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.