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

faster results buffering socket available data

Details

    Description

      Current implementation buffer socket data.
      Faster implementation would get socket available data in the buffer (limited to 16k) to permit to the socket to retrieve new data.

      This corresponds to the option "useReadAheadInput" in MySQL connector.

      benchmarks show huge improvement when having data, and neglectable slow the query without resultset (update / insert).

      Attachments

        Activity

          diego dupin Diego Dupin created issue -
          diego dupin Diego Dupin made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          diego dupin Diego Dupin made changes -
          Component/s performance [ 14519 ]
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          diego dupin Diego Dupin added a comment - - edited

          A quick benchmark results (average time for execution):

           
          test = Select 10 000 rows with 10 columns
           
          Benchmark    Mode  Cnt     Score
          cdata        avgt   30  3801.067 ± 205.842  ms/op
          mariadb      avgt   30  3510.291 ±  83.382  ms/op
          mariadb_old  avgt   30  4119.216 ± 173.522  ms/op
          mysql        avgt   30  3696.746 ±  94.048  ms/op
           
           
          test = Select * from mysql.user LIMIT 1
           
          Benchmark    Mode  Cnt     Score
          cdata        avgt   30  1070.429 ± 70.021  μs/op
          mariadb      avgt   30   167.911 ±  4.434  μs/op
          mariadb_old  avgt   30   168.994 ±  3.208  μs/op
          mysql        avgt   30   175.660 ±  2.307  μs/op
           
           
          test = DO 1
           
          Benchmark    Mode  Cnt    Score
          cdata        avgt   30  451.108 ± 29.724  μs/op
          mariadb      avgt   30  109.408 ±  3.105  μs/op
          mariadb_old  avgt   30  108.920 ±  2.746  μs/op
          mysql        avgt   30  207.637 ±  1.262  μs/op
          
          

          This show a small perf decrease for query without results (<1%) as expected, since driver now call available() on socket without need for those queries.
          Query with small resultset have a small perf increase (<1%).
          Big resultset have a real perf increase.

          diego dupin Diego Dupin added a comment - - edited A quick benchmark results (average time for execution):   test = Select 10 000 rows with 10 columns   Benchmark Mode Cnt Score cdata avgt 30 3801.067 ± 205.842 ms/op mariadb avgt 30 3510.291 ± 83.382 ms/op mariadb_old avgt 30 4119.216 ± 173.522 ms/op mysql avgt 30 3696.746 ± 94.048 ms/op     test = Select * from mysql.user LIMIT 1   Benchmark Mode Cnt Score cdata avgt 30 1070.429 ± 70.021 μs/op mariadb avgt 30 167.911 ± 4.434 μs/op mariadb_old avgt 30 168.994 ± 3.208 μs/op mysql avgt 30 175.660 ± 2.307 μs/op     test = DO 1   Benchmark Mode Cnt Score cdata avgt 30 451.108 ± 29.724 μs/op mariadb avgt 30 109.408 ± 3.105 μs/op mariadb_old avgt 30 108.920 ± 2.746 μs/op mysql avgt 30 207.637 ± 1.262 μs/op This show a small perf decrease for query without results (<1%) as expected, since driver now call available() on socket without need for those queries. Query with small resultset have a small perf increase (<1%). Big resultset have a real perf increase.
          diego dupin Diego Dupin made changes -
          Fix Version/s 1.8.0 [ 23312 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 89890 ] MariaDB v4 [ 128392 ]

          People

            diego dupin Diego Dupin
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.