Kaynağa Gözat

[ci fw-only Java/act] Update to act-1.6.4 (#3179)

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

* update to act-1.6.4

* act: add rythm template for fortunes
Green Luo 7 yıl önce
ebeveyn
işleme
83e1de9cba

+ 15 - 15
frameworks/Java/act/README.md

@@ -2,7 +2,7 @@
 
 This is the ActFramework portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
 
-This is using [ActFramework R1.5.1](http://actframework.org) to build an application.
+This is using [ActFramework R1.6.4](http://actframework.org) to build an application.
 
 ## Local benchmark result
 
@@ -10,33 +10,33 @@ This is using [ActFramework R1.5.1](http://actframework.org) to build an applica
 
 | Test | Throughput |
 | ---- | ---------: |
-| plaintext | 671911.83  |
-| json | 167184.71 |
+| plaintext | 1188983.73  |
+| json | 254222.40 |
 
 ### MySQL
 
 | Test | Throughput |
 | ---- | ----------: |
-| db | 15726.85 |
-| multiple queies (20) | 1634.25 |
-| updates (20) | 112.40 |
-| fortunes | 13340.19 |
+| db | 18160.19 |
+| multiple queries (20) | 1918.49 |
+| updates (20) | 568.46 |
+| fortunes | 18848.39 |
 
 ### Postgresql
 
 | Test | Throughput |
 | ---- | ---------: |
-| db | 19178.11 |
-| multiple queies (20) | 2108/46 |
-| updates (20) | 110.91 |
-| fortunes | 17008.39 |
+| db | 32303.52 |
+| multiple queries (20) | 3268.78 |
+| updates (20) | 865 |
+| fortunes | 27560 |
 
 
 ### Mongodb
 
 | Test | Throughput |
 | ---- | ---------: |
-| db | 19156.71 |
-| multiple queies (20) | 1821.24 |
-| updates (20) | 849.83 |
-| fortunes | 17603.13 |
+| db | 33595.57 |
+| multiple queries (20) | 2197.53 |
+| updates (20) | 1039.60 |
+| fortunes | 24301.25 |

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

@@ -5,7 +5,7 @@
       "setup_file": "setup-json-plaintext",
       "json_url": "/json",
       "plaintext_url": "/plaintext",
-      "port": 8080,
+      "port": 5460,
       "approach": "Realistic",
       "classification": "Fullstack",
       "database": "None",
@@ -27,7 +27,7 @@
       "query_url": "/queries?queries=",
       "fortune_url": "/fortunes",
       "update_url": "/updates?queries=",
-      "port": 8080,
+      "port": 5460,
       "approach": "Realistic",
       "classification": "Fullstack",
       "database": "Postgres",
@@ -49,7 +49,7 @@
       "query_url": "/queries?queries=",
       "fortune_url": "/fortunes",
       "update_url": "/updates?queries=",
-      "port": 8080,
+      "port": 5460,
       "approach": "Realistic",
       "classification": "Fullstack",
       "database": "MySQL",
@@ -71,7 +71,7 @@
       "query_url": "/queries?queries=",
       "fortune_url": "/fortunes",
       "update_url": "/updates?queries=",
-      "port": 8080,
+      "port": 5460,
       "approach": "Realistic",
       "classification": "Fullstack",
       "database": "MongoDB",

+ 7 - 156
frameworks/Java/act/pom.xml

@@ -22,7 +22,7 @@
   <groupId>com.techempower</groupId>
   <artifactId>actframework</artifactId>
   <packaging>jar</packaging>
-  <version>1.5.2</version>
+  <version>1.6.0</version>
 
   <name>TEB ActFramework Project</name>
   <description>TEB benchmark project with ActFramework</description>
@@ -34,173 +34,27 @@
   </organization>
 
   <parent>
-    <groupId>org.sonatype.oss</groupId>
-    <artifactId>oss-parent</artifactId>
-    <version>7</version>
+    <groupId>org.actframework</groupId>
+    <artifactId>act-starter-parent</artifactId>
+    <version>1.6.4.0</version>
   </parent>
 
   <properties>
-    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-    <maven.compiler.source>1.8</maven.compiler.source>
-    <maven.compiler.target>1.8</maven.compiler.target>
-    <scm.url>[email protected]:actframework/actframework.git</scm.url>
-
-    <maven-assemply-plugin.version>3.1.0</maven-assemply-plugin.version>
-    <maven-javadoc-plugin.version>3.0.0-M1</maven-javadoc-plugin.version>
-    <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
-
-    <buildnumber-maven-plugin.version>1.4</buildnumber-maven-plugin.version>
-    <license-maven-plugin.version>1.13</license-maven-plugin.version>
-    <markdown-doclet.version>1.4</markdown-doclet.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>
+    <java.version>1.8</java.version>
     <HikariCP.version>2.7.3</HikariCP.version>
     <mysql.version>5.1.44</mysql.version>
-    <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.6.1</ebean.version>
-
+    <ebean.version>11.8.1</ebean.version>
     <app.entry>com.techempower.act.AppEntry</app.entry>
   </properties>
 
-  <scm>
-    <connection>scm:git:${scm.url}</connection>
-    <developerConnection>scm:git:${scm.url}</developerConnection>
-    <url>${scm.url}</url>
-  </scm>
-
-
-  <licenses>
-    <license>
-      <name>The Apache Software License, Version 2.0</name>
-      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
-      <distribution>repo</distribution>
-    </license>
-  </licenses>
-
   <build>
-    <resources>
-      <resource>
-        <directory>src/main/resources</directory>
-        <filtering>true</filtering>
-      </resource>
-    </resources>
-
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <version>${maven-assemply-plugin.version}</version>
-        <executions>
-          <execution>
-            <id>create-archive</id>
-            <phase>package</phase>
-            <goals>
-              <goal>single</goal>
-            </goals>
-            <configuration>
-              <appendAssemblyId>false</appendAssemblyId>
-              <descriptors>
-                <descriptor>src/assembly/pkg.xml</descriptor>
-              </descriptors>
-              <outputDirectory>${project.build.directory}/dist/</outputDirectory>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>license-maven-plugin</artifactId>
-        <version>${license-maven-plugin.version}</version>
-        <configuration>
-          <licenseName>apache_v2</licenseName>
-          <verbose>false</verbose>
-        </configuration>
-        <executions>
-          <execution>
-            <id>first</id>
-            <goals>
-              <goal>update-file-header</goal>
-            </goals>
-            <phase>process-sources</phase>
-            <configuration>
-              <roots>
-                <root>src/main/java</root>
-                <root>src/test/java</root>
-              </roots>
-              <excludes>
-                <exclude>**/README</exclude>
-                <exclude>src/test/resources/**</exclude>
-                <exclude>src/main/resources/**</exclude>
-              </excludes>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>buildnumber-maven-plugin</artifactId>
-        <version>${buildnumber-maven-plugin.version}</version>
-        <executions>
-          <execution>
-            <phase>validate</phase>
-            <goals>
-              <goal>create</goal>
-            </goals>
-          </execution>
-        </executions>
-        <configuration>
-          <shortRevisionLength>4</shortRevisionLength>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-source-plugin</artifactId>
-        <version>${maven-source-plugin.version}</version>
-        <executions>
-          <execution>
-            <id>attach-sources</id>
-            <goals>
-              <goal>jar-no-fork</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
+    <finalName>${project.artifactId}-${project.version}-r${buildNumber}</finalName>
   </build>
 
   <dependencies>
 
-    <dependency>
-      <groupId>org.osgl</groupId>
-      <artifactId>osgl-ut</artifactId>
-      <version>${osgl-ut.version}</version>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>org.actframework</groupId>
-      <artifactId>act</artifactId>
-      <version>${act.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>ch.qos.logback</groupId>
-      <artifactId>logback-classic</artifactId>
-      <version>1.1.6</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.actframework</groupId>
-      <artifactId>act-mustache</artifactId>
-      <version>${act-mustache.version}</version>
-    </dependency>
-
     <dependency>
       <groupId>io.ebean</groupId>
       <artifactId>persistence-api</artifactId>
@@ -244,7 +98,6 @@
         <dependency>
           <groupId>org.actframework</groupId>
           <artifactId>act-morphia</artifactId>
-          <version>${act-morphia.version}</version>
         </dependency>
       </dependencies>
     </profile>
@@ -257,7 +110,6 @@
         <dependency>
           <groupId>org.actframework</groupId>
           <artifactId>act-ebean2</artifactId>
-          <version>${act-ebean2.version}</version>
         </dependency>
         <dependency>
           <groupId>io.ebean</groupId>
@@ -285,7 +137,6 @@
         <dependency>
           <groupId>org.actframework</groupId>
           <artifactId>act-ebean2</artifactId>
-          <version>${act-ebean2.version}</version>
         </dependency>
         <dependency>
           <groupId>io.ebean</groupId>

+ 2 - 2
frameworks/Java/act/source_code

@@ -19,8 +19,8 @@
 ./act/src/main/java/com/techempower/act/model/World.java
 ./act/src/main/java/com/techempower/act/model/Fortune.java
 ./act/src/main/resources
-./act/src/main/resources/mustache
-./act/src/main/resources/mustache/fortunes.html
+./act/src/main/resources/rythm
+./act/src/main/resources/rythm/fortunes.html
 ./act/src/main/resources/conf
 ./act/src/main/resources/conf/app.properties
 ./act/src/main/resources/conf/pgsql

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

@@ -1,8 +1,6 @@
 # disable charset output for JSON response
 render.json.output_charset=false
 
-http.port=8080
-
 # disable CLI service
 cli=false
 

+ 0 - 20
frameworks/Java/act/src/main/resources/mustache/fortunes.html

@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>Fortunes</title>
-</head>
-<body>
-<table>
-  <tr>
-    <th>id</th>
-    <th>message</th>
-  </tr>
-  {{#fortunes}}
-  <tr>
-    <td>{{id}}</td>
-    <td>{{message}}</td>
-  </tr>
-  {{/fortunes}}
-</table>
-</body>
-</html>

+ 21 - 0
frameworks/Java/act/src/main/resources/rythm/fortunes.html

@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+@args List<com.techempower.act.model.Fortune> fortunes;
+  <html>
+  <head>
+    <title>Fortunes</title>
+  </head>
+  <body>
+  <table>
+    <tr>
+      <th>id</th>
+      <th>message</th>
+    </tr>
+    @for (fortunes) {
+    <tr>
+      <td>@_.id</td>
+      <td>@_.message</td>
+    </tr>
+    }
+  </table>
+  </body>
+  </html>

+ 1 - 1
frameworks/Java/light-java/setup.sh

@@ -4,4 +4,4 @@ fw_depends postgresql mysql java maven
 
 mvn clean package
 cd target
-java -server -Xms512m -Xmx2g -jar techempower-1.0.0.jar &
+java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -server -Xms512m -Xmx2g -jar techempower-1.0.0.jar &

+ 14 - 0
frameworks/Java/wildfly-ee7/src/main/java/com/techempower/ee7/tests/PlainText.java

@@ -14,4 +14,18 @@ public class PlainText {
   public String get() {
     return MESSAGE;
   }
+
+  @GET
+  @Path("hi")
+  public String get2() {
+    return "Hello WildFly!";
+  }
+
+
+  @GET
+  @Path("/bye")
+  public String get3() {
+    return "Bye WildFly!";
+  }
+  
 }