Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-803

improve performance of parsing Columns

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      benchmarking different drivers, this shows that some part can probably be improved :

                                                            |--------------|--------------|
                                                            | java         | c            |
                                                            | mariadb      | mariadb      |
      ------------------------------------------------------|--------------|--------------|
      Select 100 int cols            - BINARY EXECUTE ONLY  | 36631 | 115% | 31971 | 100% |
      Select 100 int cols            - BINARY PIPELINE      | 17985 | 107% | 16793 | 100% |
      Select 100 int cols            - BINARY               | 15742 | 113% | 13916 | 100% |
      Select 100 int cols            - TEXT                 | 30226 | 108% | 27967 | 100% |
      ------------------------------------------------------|--------------|--------------|
      

      code for c is

      void select_100_int_cols(benchmark::State& state, MYSQL* conn) {
          int rc;
          rc = mysql_query(conn, "select * FROM test100");
          check_conn_rc(rc, conn);
       
          MYSQL_RES *result = mysql_store_result(conn);
          
          if (result == NULL) {
                fprintf(stderr, "%s\n", mysql_error(conn));
                mysql_close(conn);
                exit(1);
          }
       
          int val1;
          MYSQL_ROW row;
          while ((row = mysql_fetch_row(result))) {
              for (int i=0; i<100; i++)
                  benchmark::DoNotOptimize(val1 = atoi(row[i]));
              benchmark::ClobberMemory();
          }
       
          mysql_free_result(result);
      }
      

      culprit seems to be either because of column parsing or store results.
      other difference might be because java just store columns meta as bytes, decoding to utf8 only when requested, since rarely needed

      Attachments

        Activity

          People

            georg Georg Richter
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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