Ticket #11709: 0003-Added-count-of-apply-calls-to-output.patch

File 0003-Added-count-of-apply-calls-to-output.patch, 1.8 KB (added by michael2402, 10 years ago)
  • test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSourceFilterTest.java

    From 61fd934754a2f5afde8785d4cfb1390b8ad7deee Mon Sep 17 00:00:00 2001
    From: Michael Zangl <michael.zangl@student.kit.edu>
    Date: Mon, 20 Jul 2015 14:56:33 +0200
    Subject: [PATCH 3/4] Added count of apply calls to output.
    
    ---
     .../josm/gui/mappaint/mapcss/MapCSSStyleSourceFilterTest.java        | 5 ++---
     1 file changed, 2 insertions(+), 3 deletions(-)
    
    diff --git a/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSourceFilterTest.java b/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSourceFilterTest.java
    index 8b28279..e828005 100644
    a b public class MapCSSStyleSourceFilterTest {  
    6060        public CssGenerator addIsTrueRules(int count) {
    6161            for (int i = 0; i < count; i++) {
    6262                String key = generator.randomKey();
    63                 // TODO
    6463                addRule("node[\"" + key + "\"?]");
    6564            }
    6665            return this;
    public class MapCSSStyleSourceFilterTest {  
    7574        }
    7675    }
    7776
    78     private static final int APPLY_CALLS = 1000000;
     77    private static final int APPLY_CALLS = 100000;
    7978
    8079    /**
    8180     * Prepare the test.
    public class MapCSSStyleSourceFilterTest {  
    135134        source.loadStyleSource();
    136135        timer.done();
    137136
    138         timer = PerformanceTestUtils.startTimer("MapCSSStyleSource#apply(...) for " + description);
     137        timer = PerformanceTestUtils.startTimer(APPLY_CALLS + "x MapCSSStyleSource#apply(...) for " + description);
    139138        for (int i = 0; i < APPLY_CALLS; i++) {
    140139            MultiCascade mc = new MultiCascade();
    141140            source.apply(mc, data.randomNode(), 1, false);