mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-23 16:44:11 -08:00
Modifying the jbox2d benchmark to also generate Bck2Brwsr version of the sample
This commit is contained in:
parent
103fc0f9cc
commit
a56a9c15a7
15
pom.xml
15
pom.xml
|
@ -218,21 +218,6 @@
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||||
<version>2.11</version>
|
<version>2.11</version>
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>validate</id>
|
|
||||||
<phase>validate</phase>
|
|
||||||
<configuration>
|
|
||||||
<encoding>UTF-8</encoding>
|
|
||||||
<consoleOutput>true</consoleOutput>
|
|
||||||
<failsOnError>true</failsOnError>
|
|
||||||
<linkXRef>false</linkXRef>
|
|
||||||
</configuration>
|
|
||||||
<goals>
|
|
||||||
<goal>check</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<propertyExpansion>config_loc=${basedir}/..</propertyExpansion>
|
<propertyExpansion>config_loc=${basedir}/..</propertyExpansion>
|
||||||
<configLocation>../checkstyle.xml</configLocation>
|
<configLocation>../checkstyle.xml</configLocation>
|
||||||
|
|
|
@ -33,16 +33,19 @@
|
||||||
<groupId>org.teavm</groupId>
|
<groupId>org.teavm</groupId>
|
||||||
<artifactId>teavm-classlib</artifactId>
|
<artifactId>teavm-classlib</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.teavm</groupId>
|
<groupId>org.teavm</groupId>
|
||||||
<artifactId>teavm-jso</artifactId>
|
<artifactId>teavm-jso</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.teavm</groupId>
|
<groupId>org.teavm</groupId>
|
||||||
<artifactId>teavm-dom</artifactId>
|
<artifactId>teavm-dom</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jbox2d</groupId>
|
<groupId>org.jbox2d</groupId>
|
||||||
|
@ -54,6 +57,13 @@
|
||||||
<artifactId>jbox2d-library</artifactId>
|
<artifactId>jbox2d-library</artifactId>
|
||||||
<version>2.2.1.1</version>
|
<version>2.2.1.1</version>
|
||||||
<classifier>sources</classifier>
|
<classifier>sources</classifier>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apidesign.bck2brwsr</groupId>
|
||||||
|
<artifactId>emul</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<classifier>rt</classifier>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.gwt</groupId>
|
<groupId>com.google.gwt</groupId>
|
||||||
|
@ -77,44 +87,96 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.teavm</groupId>
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
<artifactId>teavm-maven-plugin</artifactId>
|
<version>2.5</version>
|
||||||
<version>${project.version}</version>
|
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>web-client</id>
|
<phase>prepare-package</phase>
|
||||||
<phase>prepare-package</phase>
|
<goals>
|
||||||
<goals>
|
<goal>jar</goal>
|
||||||
<goal>build-javascript</goal>
|
</goals>
|
||||||
</goals>
|
<configuration>
|
||||||
<configuration>
|
<archive>
|
||||||
<targetDirectory>${project.build.directory}/generated/js/teavm</targetDirectory>
|
<manifest>
|
||||||
<mainClass>org.teavm.samples.benchmark.teavm.BenchmarkStarter</mainClass>
|
<mainClass>org.teamvm.samples.benchmark.bck2brwsr.BenchmarkStarter</mainClass>
|
||||||
<runtime>SEPARATE</runtime>
|
<addClasspath>true</addClasspath>
|
||||||
<minifying>false</minifying>
|
<classpathPrefix>lib/</classpathPrefix>
|
||||||
<debugInformationGenerated>true</debugInformationGenerated>
|
<useUniqueVersions>false</useUniqueVersions>
|
||||||
</configuration>
|
</manifest>
|
||||||
</execution>
|
</archive>
|
||||||
|
<excludes>
|
||||||
|
<exclude>**/gwt/*</exclude>
|
||||||
|
<exclude>**/teavm/*</exclude>
|
||||||
|
</excludes>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.teavm</groupId>
|
||||||
<artifactId>gwt-maven-plugin</artifactId>
|
<artifactId>teavm-maven-plugin</artifactId>
|
||||||
<version>2.7.0</version>
|
<version>${project.version}</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<goals>
|
<id>web-client</id>
|
||||||
<goal>compile</goal>
|
<phase>prepare-package</phase>
|
||||||
</goals>
|
<goals>
|
||||||
<configuration>
|
<goal>build-javascript</goal>
|
||||||
<optimizationLevel>9</optimizationLevel>
|
</goals>
|
||||||
<compileSourcesArtifacts>
|
<configuration>
|
||||||
<item>org.jbox2d:jbox2d-library</item>
|
<targetDirectory>${project.build.directory}/generated/js/teavm</targetDirectory>
|
||||||
</compileSourcesArtifacts>
|
<mainClass>org.teavm.samples.benchmark.teavm.BenchmarkStarter</mainClass>
|
||||||
</configuration>
|
<runtime>SEPARATE</runtime>
|
||||||
</execution>
|
<minifying>false</minifying>
|
||||||
</executions>
|
<debugInformationGenerated>true</debugInformationGenerated>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>gwt-maven-plugin</artifactId>
|
||||||
|
<version>2.7.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>compile</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<optimizationLevel>9</optimizationLevel>
|
||||||
|
<compileSourcesArtifacts>
|
||||||
|
<item>org.jbox2d:jbox2d-library</item>
|
||||||
|
</compileSourcesArtifacts>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apidesign.bck2brwsr</groupId>
|
||||||
|
<artifactId>bck2brwsr-maven-plugin</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>prepare-package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>aot</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<obfuscation>NONE</obfuscation>
|
||||||
|
<classPathPrefix>lib</classPathPrefix>
|
||||||
|
<mainJavaScript>${project.build.directory}/generated/js/b2b-benchmark.js</mainJavaScript>
|
||||||
|
<vm>${project.build.directory}/generated/js/bck2brwsr.js</vm>
|
||||||
|
<exports>
|
||||||
|
<export>org.teavm.samples.benchmark.bck2brwsr.BenchmarkStarter</export>
|
||||||
|
<export>org/jbox2d/collision/shapes/</export>
|
||||||
|
<export>org/jbox2d/common/</export>
|
||||||
|
<export>org/jbox2d/dynamics/</export>
|
||||||
|
<export>org/jbox2d/dynamics/joints/</export>
|
||||||
|
</exports>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2015 Jaroslav Tulach.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.samples.benchmark.bck2brwsr;
|
||||||
|
|
||||||
|
import org.teavm.samples.benchmark.Scene;
|
||||||
|
|
||||||
|
public class BenchmarkStarter {
|
||||||
|
private static Scene s = new Scene();
|
||||||
|
|
||||||
|
public static void main(String... args) {
|
||||||
|
s.calculate();
|
||||||
|
throw new IllegalStateException("Success!");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
<!--
|
||||||
|
Copyright 2014 Alexey Andreev.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||||
|
<title>Bck2Brwsr jbox2d benchmark</title>
|
||||||
|
</head>
|
||||||
|
<body onload="main()">
|
||||||
|
<h1>Bck2Brwsr performance</h1>
|
||||||
|
<div>
|
||||||
|
<canvas id="benchmark-canvas" width="600" height="600"></canvas>
|
||||||
|
</div>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Second</th>
|
||||||
|
<th>Time spent computing, ms</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="result-table-body">
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<!-- boot bck2brwsr -->
|
||||||
|
<script type="text/javascript" src="bck2brwsr.js"></script>
|
||||||
|
<script>
|
||||||
|
var vm = bck2brwsr('b2b-benchmark.js');
|
||||||
|
var c = vm.loadClass('org.teavm.samples.benchmark.bck2brwsr.BenchmarkStarter');
|
||||||
|
c.invoke('main');
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</html>
|
|
@ -17,13 +17,14 @@
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||||
<title>TeaVM vs. GWT performance comparison</title>
|
<title>TeaVM vs. GWT vs. Bck2Brwsr performance comparison</title>
|
||||||
</head>
|
</head>
|
||||||
<body onload="main()">
|
<body onload="main()">
|
||||||
<h1>TeaVM vs. GWT performance</h1>
|
<h1>TeaVM vs. GWT vs. Bck2Brwsr performance</h1>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="teavm.html">TeaVM</a></li>
|
<li><a href="teavm.html">TeaVM</a></li>
|
||||||
<li><a href="gwt.html">GWT</a></li>
|
<li><a href="gwt.html">GWT</a></li>
|
||||||
|
<li><a href="bck2brwsr.html">Bck2Brwsr VM</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue
Block a user