Description:
There is a performance regression of roughly 25% between r906 and r907, which appears to be caused by pushing the Proxy down to the I/O layer. Specifically, it appears to be a regression caused by the code implemented in BUG#51643.
Using test case provided, for r906:
Mean TPS: 2909.837792987103
For r907:
Mean TPS: 2252.1763514319264
How to repeat:
public static void main(String[] args) {
Connection con = null;
String URL = "localhost:3306,localhost:3309,localhost:3310/test";
String sqlUser = "root";
String sqlPasswd = "";
int iterations = 10000;
int studies = 10;
double totalTPS = 0.0;
double totalDuration = 0.0;
try {
for(int j = 0; j < studies; j++){
Class.forName("com.mysql.jdbc.Driver");
String url =
"jdbc:mysql:loadbalance://" + URL ;
long start = System.currentTimeMillis();
con = DriverManager.getConnection(url,sqlUser, sqlPasswd);
con.setAutoCommit(false);
for(int i = 0; i < iterations; i++){
con.createStatement().execute("SELECT 1");
con.commit();
}
long duration = System.currentTimeMillis() - start;
System.out.println("Transactions per second: " + iterations / (duration / 1000.0));
System.out.println("Duration: " + (duration / 1000.0));
totalTPS += iterations / (duration / 1000.0);
totalDuration += (duration / 1000.0);
}
System.out.println("Driver Version: " + con.getMetaData().getDriverVersion());
System.out.println("Mean TPS: " + totalTPS / studies );
}catch( Exception e ) {
e.printStackTrace();
} finally {
try{
if(con != null){
con.close();
}
} catch (SQLException e){
e.printStackTrace();
}
}
}
Suggested fix:
Find more efficient way to proxy necessary operations.