Skip to content

Commit 353444b

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents cff12cd + 568f4f8 commit 353444b

File tree

24 files changed

+284
-75
lines changed

24 files changed

+284
-75
lines changed

frameworks/Java/activeweb/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
<dependency>
116116
<groupId>com.fasterxml.jackson.core</groupId>
117117
<artifactId>jackson-core</artifactId>
118-
<version>2.9.9</version>
118+
<version>2.13.0</version>
119119
</dependency>
120120
<dependency>
121121
<groupId>com.fasterxml.jackson.core</groupId>

frameworks/Java/avaje-jex/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<dependency>
5959
<groupId>org.postgresql</groupId>
6060
<artifactId>postgresql</artifactId>
61-
<version>42.7.5</version>
61+
<version>42.7.6</version>
6262
</dependency>
6363

6464
<dependency>

frameworks/Java/avaje-jex/src/main/java/benchmark/repository/HikariFactory.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import io.avaje.config.Config;
66
import io.avaje.inject.Bean;
77
import io.avaje.inject.Factory;
8+
import java.util.concurrent.Executors;
89
import javax.sql.DataSource;
910

1011
@Factory
@@ -22,8 +23,21 @@ DataSource dataSource() {
2223
maxPoolSize = Config.getInt("postgresDefaultPoolSize");
2324
}
2425

25-
var hikari = new HikariDataSource(new HikariConfig("hikari.properties"));
26-
hikari.setMaximumPoolSize(maxPoolSize);
27-
return hikari;
26+
maxPoolSize = Math.max(maxPoolSize, Runtime.getRuntime().availableProcessors() * 2);
27+
HikariConfig hikariConfig = new HikariConfig("hikari.properties");
28+
29+
var vtThreadFactory = Thread.ofVirtual().factory();
30+
hikariConfig.setThreadFactory(vtThreadFactory);
31+
hikariConfig.setScheduledExecutor(
32+
Executors.newScheduledThreadPool(maxPoolSize, vtThreadFactory));
33+
34+
// data source properties
35+
hikariConfig.addDataSourceProperty("cachePrepStmts", "true");
36+
hikariConfig.addDataSourceProperty("prepStmtCacheSize", "250");
37+
hikariConfig.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
38+
hikariConfig.addDataSourceProperty("ssl", "false");
39+
hikariConfig.addDataSourceProperty("tcpKeepAlive", "true");
40+
hikariConfig.setMaximumPoolSize(maxPoolSize);
41+
return new HikariDataSource(hikariConfig);
2842
}
2943
}

frameworks/Java/avaje-jex/src/main/java/benchmark/repository/JDBCDbService.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public JDBCDbService(DataSource connectionFactory) {
2222
}
2323

2424
@Override
25-
public List<World> getWorld(int num) {
25+
public List<World> getWorld(int num) throws SQLException {
2626

2727
String select = "select id, randomNumber from World where id = ?";
2828
List<World> worldList = new ArrayList<>();
@@ -37,8 +37,6 @@ public List<World> getWorld(int num) {
3737
worldList.add(new World(rs.getInt("id"), rs.getInt("randomNumber")));
3838
}
3939
}
40-
} catch (SQLException e) {
41-
throw new RuntimeException(e);
4240
}
4341

4442
return worldList;
@@ -55,7 +53,7 @@ public List<Fortune> getFortune() throws SQLException {
5553
ResultSet rs = pstm.executeQuery()) {
5654

5755
while (rs.next()) {
58-
fortuneList.add(new Fortune(rs.getInt("id"), rs.getString("message")));
56+
fortuneList.add(new Fortune(rs.getInt(1), rs.getString(2)));
5957
}
6058
fortuneList.add(new Fortune(defaultFortuneId, defaultFortuneMessage));
6159
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
physicalTag=Citrine
22
cloudTag=Azure
33

4-
postgresPhysicalPoolSize=56
4+
postgresPhysicalPoolSize=64
55
postgresCloudPoolSize=16
66
postgresDefaultPoolSize=10

frameworks/Java/avaje-jex/src/main/resources/hikari.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dataSourceClassName=org.postgresql.ds.PGSimpleDataSource
1+
jdbcUrl=jdbc:postgresql://tfb-database:5432/hello_world
22
dataSource.serverName=tfb-database
33
dataSource.portNumber=5432
44
dataSource.user=benchmarkdbuser

frameworks/Java/ninja-standalone/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<dependency>
5252
<groupId>com.fasterxml.jackson.core</groupId>
5353
<artifactId>jackson-core</artifactId>
54-
<version>2.9.9</version>
54+
<version>2.13.0</version>
5555
</dependency>
5656
<dependency>
5757
<groupId>com.fasterxml.jackson.module</groupId>

frameworks/Java/smart-socket/pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
<dependency>
2121
<groupId>tech.smartboot.feat</groupId>
2222
<artifactId>feat-cloud-starter</artifactId>
23-
<version>0.9.0</version>
24-
</dependency>
25-
<dependency>
26-
<groupId>io.github.smartboot.socket</groupId>
27-
<artifactId>aio-pro</artifactId>
28-
<version>1.5.62-SNAPSHOT</version>
23+
<version>1.1.0-SNAPSHOT</version>
2924
</dependency>
25+
<!-- <dependency>-->
26+
<!-- <groupId>io.github.smartboot.socket</groupId>-->
27+
<!-- <artifactId>aio-pro</artifactId>-->
28+
<!-- <version>1.5.62-SNAPSHOT</version>-->
29+
<!-- </dependency>-->
3030
<dependency>
3131
<groupId>tech.smartboot.servlet</groupId>
3232
<artifactId>servlet-core</artifactId>

frameworks/Java/tio-boot/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<java.version>1.8</java.version>
1212
<maven.compiler.source>${java.version}</maven.compiler.source>
1313
<maven.compiler.target>${java.version}</maven.compiler.target>
14-
<tio-boot.version>1.9.5</tio-boot.version>
14+
<tio-boot.version>1.9.8</tio-boot.version>
1515

1616

1717
<main.class>com.litongjava.tio.http.server.MainApp</main.class>

frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/MainAppConfig.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import com.litongjava.tio.http.server.config.EhCachePluginConfig;
66
import com.litongjava.tio.http.server.config.EnjoyEngineConfig;
77
import com.litongjava.tio.http.server.config.MysqlDbConfig;
8-
import com.litongjava.tio.http.server.controller.CacheHandler;
9-
import com.litongjava.tio.http.server.controller.DbHandler;
10-
import com.litongjava.tio.http.server.controller.IndexHandler;
8+
import com.litongjava.tio.http.server.handler.CacheHandler;
9+
import com.litongjava.tio.http.server.handler.DbHandler;
10+
import com.litongjava.tio.http.server.handler.IndexHandler;
1111
import com.litongjava.tio.http.server.router.HttpRequestRouter;
1212
import com.litongjava.tio.utils.environment.EnvUtils;
1313

@@ -38,7 +38,6 @@ public void config() throws Exception {
3838
TioBootServer server = TioBootServer.me();
3939
HttpRequestRouter requestRouter = server.getRequestRouter();
4040
if (requestRouter != null) {
41-
requestRouter.add("/", controller::index);
4241
requestRouter.add("/plaintext", controller::plaintext);
4342
requestRouter.add("/json", controller::json);
4443

0 commit comments

Comments
 (0)