Open Chris2018998 opened 4 years ago
Have you read through the various Wiki's especially this one https://github.com/brettwooldridge/HikariCP/wiki/%22My-benchmark-doesn't-show-a-difference.%22?
Hi Bill,
Thank you very much. I have read it and add some connection reset code to my pool, then retested it, but the performance score still be high(the score has reduced, which is right direction), my test code
private void setupBeeCPWithCompete(){
BeeDataSourceConfig config = new BeeDataSourceConfig();
config.setDriverClassName(jdbcDriver);
config.setJdbcUrl(jdbcUrl);
config.setUsername(jdbcUsername);
config.setPassword(jdbcPassword);
config.setMaxActive(maxPoolSize);
config.setInitialSize(MIN_POOL_SIZE);
config.setMaxWait(8000);
config.setPreparedStatementCacheSize(10);
config.setConnectionTestSQL("select 1 from dual");
config.setClearSQLWarnings(true);
config.setTestOnBorrow(true);
config.setDefaultAutoCommit(false); //<----- maybe here(new code added )
DS = new BeeDataSource(config);
}
I added a real db table to the benchmark source to test 'roll back on return'
@Setup(Level.Trial)
public void setup(BenchmarkParams params)
{
//...........
switch (pool)
{
case "hikari":
stmSQL="INSERT INTO test(ds_name)VALUES ('hikari')";
setupHikari();
break;
case "tomcat":
stmSQL="INSERT INTO test(ds_name)VALUES ('tomcat')";
setupTomcat();
break;
case "beeCP-compete":
stmSQL="INSERT INTO test(ds_name)VALUES ('beeCP-compete')";
setupBeeCPWithCompete();
break;
//...........
}
}
1 retested result with stubDriver( PC: I3-7100, 8G )
2 retested with Mysql5.6.4-64 ( PC: I3-7100, 8G )
I have uploaded the test package to my project, download url is: https://github.com/Chris2018998/BeeCP/blob/master/doc/performance/HikariCP-benchmark_BeeCP.zip
Dear All,
I am a Java new, I made a simple JDBC Pool(BeeCP:http://www.github.com/Chris2018998/BeeCP),
and tested its performance with HikariCP‘ benchmark,but its score is higher than 'HikariCP'.
please help me to find out the cause. Appreciate for help from anyone.
It is not a AD, thanks!