Permalink
Browse files

Removed benchmark suite. It's rarely used and is just slowing down dev

  • Loading branch information...
joewalnes committed Jan 20, 2010
1 parent 4e055e7 commit 21055bf59de6bc9324dc186474ca813c19b4bdff
View
@@ -17,7 +17,6 @@ The subdirectories in this package are modules. They are:
* sitemesh : Main SiteMesh project
* sitemesh-examples-*: End user examples
-* sitemesh-tools-*: Tools used by SiteMesh development team
=== IDE instructions ===
View
@@ -7,7 +7,7 @@
POM_VERSION=3.0.0-SNAPSHOT
RELEASE_VERSION=3.0-alpha-1
-MODULES_TO_PACKAGE="sitemesh sitemesh-examples-* sitemesh-tools-benchmark"
+MODULES_TO_PACKAGE="sitemesh sitemesh-examples-*"
mvn clean && mvn package
View
@@ -18,7 +18,6 @@
<modules>
<module>sitemesh</module>
- <module>sitemesh-tools-benchmark</module>
<module>sitemesh-examples-hellowebapp</module>
</modules>
@@ -1,4 +0,0 @@
-.classpath
-.project
-.settings
-target/*
@@ -1,11 +0,0 @@
-These microbenchmarks use the Japex tool.
-https://japex.dev.java.net/
-
-In a nutshell:
-- A 'Driver' class defines the code to be executed in the benchmark.
-- The configuration for each micro-benchmark suite lives in a config file
- in src/benchmark/config. This consists of the drivers to use and
- the input data.
-- The Japex tool runs the benchmarks and outputs the results.
-
-TODO: How to run this from Maven?
@@ -1,47 +0,0 @@
-<project>
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <artifactId>sitemesh-parent</artifactId>
- <groupId>org.sitemesh</groupId>
- <version>3.0.0-SNAPSHOT</version>
- <relativePath>../</relativePath>
- </parent>
-
- <artifactId>sitemesh-tools-benchmark</artifactId>
- <name>SiteMesh benchmarking tools</name>
-
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>sitemesh</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <!-- Japex dependencies -->
- <dependency>
- <groupId>com.sun.japex</groupId>
- <artifactId>japex</artifactId>
- <version>1.0.25</version>
- </dependency>
- <dependency>
- <groupId>jfree</groupId>
- <artifactId>jfreechart</artifactId>
- <version>1.0.8a</version>
- </dependency>
- <dependency>
- <groupId>jfree</groupId>
- <artifactId>jcommon</artifactId>
- <version>1.0.14</version>
- <exclusions>
- <!-- Workaround a broken jCommon POM -->
- <exclusion>
- <groupId>gnujaxp</groupId>
- <artifactId>gnujaxp</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
-</project>
@@ -1,31 +0,0 @@
-<testSuite name="SiteMesh ContentProcessor Benchmark" xmlns="http://www.sun.com/japex/testSuite">
-
- <!-- See https://japex.dev.java.net/docs/manual.html -->
-
- <param name="dataDir" value="sitemesh-tools-benchmark/src/benchmark/data/contentprocessor"/>
- <param name="japex.classPath" value="dist/*.jar:sitemesh-tools-benchmark/build/main/classes"/>
- <param name="japex.reportsDirectory" value="sitemesh-tools-benchmark/build/benchmark-reports/contentprocessor"/>
-
- <param name="japex.warmupTime" value="1"/>
- <param name="japex.runTime" value="5"/>
- <param name="japex.numberOfThreads" value="5"/>
-
- <!-- possible values: barchart, linechart, scatterchart -->
- <param name="japex.chartType" value="barchart"/>
-
- <!-- possible values: tps, mps, mbps -->
- <param name="japex.resultUnit" value="ms"/>
-
- <driver name="org.sitemesh.microbenchmark.contentprocessor.TagBasedContentProcessorDriver">
- <param name="Description" value="TagBasedContentProcessor"/>
- </driver>
-
- <testCase name="tiny">
- <param name="japex.inputFile" value="${dataDir}/tiny.html"/>
- </testCase>
-
- <testCase name="large">
- <param name="japex.inputFile" value="${dataDir}/large.html"/>
- </testCase>
-
-</testSuite>

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,3 +0,0 @@
-<html>
-<body>Tiny</body>
-</html>
@@ -1,77 +0,0 @@
-package org.sitemesh.microbenchmark.contentprocessor;
-
-import org.sitemesh.content.ContentProcessor;
-import org.sitemesh.webapp.contentfilter.io.TextEncoder;
-import com.sun.japex.JapexDriverBase;
-import com.sun.japex.TestCase;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.channels.FileChannel;
-
-/**
- * Base implementation of a Japex driver for testing the speed of a {@link ContentProcessor}.
- *
- * See src/benchmark/README.txt and https://japex.dev.java.net/.
- *
- * @author Joe Walnes
- */
-public abstract class BaseContentProcessorDriver extends JapexDriverBase {
-
- /**
- * ContentProcessor implementation to be benchmarked.
- */
- private ContentProcessor contentProcessor;
-
- /**
- * Data used for benchmarking.
- */
- private CharBuffer data;
-
- /**
- * Factory method - subclasses should implement this to return a suitable
- * implementation.
- */
- protected abstract ContentProcessor createProcessor();
-
- /**
- * Preparation phase: Load input data into CharBuffer.
- */
- @Override
- public void prepare(TestCase testCase) {
- try {
- contentProcessor = createProcessor();
- data = loadFile(new File(testCase.getParam("japex.inputFile")));
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Run phase: Build content from data. This method is called many times.
- */
- @Override
- public void run(TestCase testCase) {
- try {
- contentProcessor.build(data, null);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- private CharBuffer loadFile(File file) throws IOException {
- FileInputStream inputStream = new FileInputStream(file);
- try {
- FileChannel channel = inputStream.getChannel();
- ByteBuffer bytes = ByteBuffer.allocate((int) channel.size());
- channel.read(bytes);
- return TextEncoder.encode(bytes, null);
- } finally {
- inputStream.close();
- }
- }
-
-}
@@ -1,16 +0,0 @@
-package org.sitemesh.microbenchmark.contentprocessor;
-
-import org.sitemesh.content.ContentProcessor;
-import org.sitemesh.content.tagrules.html.CoreHtmlTagRuleBundle;
-import org.sitemesh.content.tagrules.decorate.DecoratorTagRuleBundle;
-import org.sitemesh.content.tagrules.TagBasedContentProcessor;
-
-/**
- * @author Joe Walnes
- */
-public class TagBasedContentProcessorDriver extends BaseContentProcessorDriver {
- @Override
- protected ContentProcessor createProcessor() {
- return new TagBasedContentProcessor(new CoreHtmlTagRuleBundle(), new DecoratorTagRuleBundle());
- }
-}

0 comments on commit 21055bf

Please sign in to comment.