Forráskód Böngészése

[ci fw-only Java/act] Update to act-1.5.3; fix ebean updates performance issue (#3086)

* add act-ebean-pgsql-rythm to compare rythm vs mustache template engine

* update to act-1.5.1, act-ebean2-1.1.5. act-morphia-1.2.2

* update README

* add useSSL=false to mysql db.url configuration

* update to act-1.5.3; fix ebean update test performance issue

* update benchmark_config: rename json_plaintext test to default
Green Luo 7 éve
szülő
commit
464f4b2ca5

+ 1 - 1
frameworks/Java/act/benchmark_config.json

@@ -1,7 +1,7 @@
 {
   "framework": "actframework",
   "tests": [{
-      "json_plaintext": {
+      "default": {
       "setup_file": "setup-json-plaintext",
       "json_url": "/json",
       "plaintext_url": "/plaintext",

+ 3 - 3
frameworks/Java/act/pom.xml

@@ -22,7 +22,7 @@
   <groupId>com.techempower</groupId>
   <artifactId>actframework</artifactId>
   <packaging>jar</packaging>
-  <version>1.5.1</version>
+  <version>1.5.2</version>
 
   <name>TEB ActFramework Project</name>
   <description>TEB benchmark project with ActFramework</description>
@@ -54,7 +54,7 @@
     <license-maven-plugin.version>1.13</license-maven-plugin.version>
     <markdown-doclet.version>1.4</markdown-doclet.version>
 
-    <act.version>1.5.1</act.version>
+    <act.version>1.5.3</act.version>
     <act-ebean2.version>1.1.5</act-ebean2.version>
     <act-mustache.version>1.2.1</act-mustache.version>
     <act-morphia.version>1.2.2</act-morphia.version>
@@ -63,7 +63,7 @@
     <osgl-ut.version>1.0.0-BETA-6</osgl-ut.version>
     <postgres-jdbc.version>42.1.4</postgres-jdbc.version>
     <morphia.version>1.3.2</morphia.version>
-    <ebean.version>11.5.1</ebean.version>
+    <ebean.version>11.6.1</ebean.version>
 
     <app.entry>com.techempower.act.AppEntry</app.entry>
   </properties>

+ 8 - 2
frameworks/Java/act/src/main/java/com/techempower/act/controller/WorldController.java

@@ -52,6 +52,8 @@ public class WorldController {
      */
     private static final Const<Integer> WORLD_MAX_ROW = $.constant();
 
+    private static boolean BATCH_SAVE = true;
+
     @Global
     @Inject
     private Dao<Integer, World, ?> dao;
@@ -80,13 +82,14 @@ public class WorldController {
         return doUpdate(q);
     }
 
-    @Transactional
     private List<World> doUpdate(int q) {
         List<World> retVal = new ArrayList<>(q);
         for (int i = 0; i < q; ++i) {
             retVal.add(findAndModifyOne());
         }
-        dao.save(retVal);
+        if (BATCH_SAVE) {
+            dao.save(retVal);
+        }
         return retVal;
     }
 
@@ -94,6 +97,9 @@ public class WorldController {
         World world = findOne();
         notFoundIfNull(world);
         world.randomNumber = randomWorldNumber();
+        if (!BATCH_SAVE) {
+            dao.save(world);
+        }
         return world;
     }
 

+ 2 - 0
frameworks/Java/act/src/main/resources/conf/mysql/db.properties

@@ -1,5 +1,7 @@
 mysql.host=localhost
 
+app.batch_save=false
+
 db.impl=act.db.ebean2.EbeanPlugin
 db.url=jdbc:mysql://${mysql.host}:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts=true&cacheRSMetadata=true&serverTimezone=UTC&useSSL=false
 db.username=benchmarkdbuser

+ 2 - 0
frameworks/Java/act/src/main/resources/conf/pgsql/db.properties

@@ -1,5 +1,7 @@
 pgsql.host=localhost
 
+app.batch.save=false
+
 db.impl=act.db.ebean2.EbeanPlugin
 db.url=jdbc:postgresql://${pgsql.host}:5432/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true
 db.username=benchmarkdbuser