From ded9f06f42bbe751bdec3d763ae5216d76df82c4 Mon Sep 17 00:00:00 2001 From: ToineSiebelink Date: Thu, 22 Dec 2022 14:47:07 +0000 Subject: Temp Table Creation improvements - extracted methods for more generic temp table creation - optimized - added perf test on use case that depends on temp table creation - had some doubts about stopwatch use in recent tests, but was all OK, just renamed some Issue-ID: CPS-1422 Signed-off-by: ToineSiebelink Change-Id: I22cabb9b0ba1b0aa8576a2d756d77af46eebc1b0 --- .../groovy/org/onap/cps/cpspath/parser/CpsPathUtilSpec.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cps-path-parser') diff --git a/cps-path-parser/src/test/groovy/org/onap/cps/cpspath/parser/CpsPathUtilSpec.groovy b/cps-path-parser/src/test/groovy/org/onap/cps/cpspath/parser/CpsPathUtilSpec.groovy index df2e9d72c..f1a878d63 100644 --- a/cps-path-parser/src/test/groovy/org/onap/cps/cpspath/parser/CpsPathUtilSpec.groovy +++ b/cps-path-parser/src/test/groovy/org/onap/cps/cpspath/parser/CpsPathUtilSpec.groovy @@ -74,16 +74,16 @@ class CpsPathUtilSpec extends Specification { def 'CPS Path Processing Performance Test.'() { when: '200,000 paths are processed' - def setupStopWatch = new StopWatch() - setupStopWatch.start() + def stopWatch = new StopWatch() + stopWatch.start() (1..100000).each { CpsPathUtil.getNormalizedXpath('/long/path/to/see/if/it/adds/paring/time/significantly/parent/child[@common-leaf-name="123"]') CpsPathUtil.getNormalizedXpath('//child[@other-leaf=1]/leaf-name[text()="search"]/ancestor::parent') } - setupStopWatch.stop() + stopWatch.stop() then: 'it takes less then 10,000 milliseconds' // In CI this actually takes about 3-5 sec which is approx. 50+ parser executions per millisecond! - assert setupStopWatch.getTotalTimeMillis() < 10000 + assert stopWatch.getTotalTimeMillis() < 10000 } } -- cgit 1.2.3-korg