Skip to content

Commit

Permalink
JMH: move DoubleStringPerformanceMark to a svggen.jmh package for…
Browse files Browse the repository at this point in the history
… improved modular compatibility
  • Loading branch information
carlosame committed Jun 18, 2024
1 parent a5ce32b commit c587c8f
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/
package io.sf.carte.echosvg.svggen;
package io.sf.carte.echosvg.svggen.jmh;

import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Fork;
Expand All @@ -27,6 +27,7 @@
import org.w3c.dom.Document;

import io.sf.carte.echosvg.anim.dom.SVGDOMImplementation;
import io.sf.carte.echosvg.svggen.SVGGeneratorContext;

/**
* This test checks that there is no performance degradation in the doubleString
Expand All @@ -49,7 +50,7 @@ public void DoubleStringMark() {
DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
Document doc = impl.createDocument(svgNS, "svg", null);
final SVGGeneratorContext gc = new SVGGeneratorContext(doc);
final SVGGeneratorContext gc = new MarkGeneratorContext(doc);

int maxLength = 0;
for (int i = 0; i < 1000; i++) {
Expand All @@ -59,4 +60,10 @@ public void DoubleStringMark() {
}
}

static class MarkGeneratorContext extends SVGGeneratorContext {
MarkGeneratorContext (Document doc) {
super(doc);
}
}

}

0 comments on commit c587c8f

Please sign in to comment.