From f7fe2b9dd341f2e2f0a23cbd8ea40b49ecfea44e Mon Sep 17 00:00:00 2001 From: Fabian Pichler Date: Sat, 25 Jun 2022 13:41:35 +0200 Subject: [PATCH 1/6] benchmarking --- src/main/webapp/templates/celMacros/benchmark.vm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/templates/celMacros/benchmark.vm b/src/main/webapp/templates/celMacros/benchmark.vm index 5d077b7bc..dac15eb60 100644 --- a/src/main/webapp/templates/celMacros/benchmark.vm +++ b/src/main/webapp/templates/celMacros/benchmark.vm @@ -4,17 +4,20 @@ ## INPUT label to distinguish time printouts #set($bench_startTime = $datetool.date.time) -#set($bench_lastTime = $bench_startTime) +$services.celementsweb.setGlobalContextValue('bench_startTime', $bench_startTime) +$services.celementsweb.setGlobalContextValue('bench_lastTime', $bench_startTime) #macro(bench $label $visible) #if($isSuperAdmin) #set($visible = $visible || ("$!request.showBenchmark" == 'true')) #set($currTime = $datetool.date.time) + #set($bench_startTime = $services.celementsweb.getGlobalContextValue('bench_startTime')) + #set($bench_lastTime = $services.celementsweb.getGlobalContextValue('bench_lastTime')) #set($totalTime = ($currTime - $bench_startTime) / 1000.0) #set($time = ($currTime - $bench_lastTime) / 1000.0) #if(!$visible) #end - #set($bench_lastTime = $currTime) + $services.celementsweb.setGlobalContextValue('bench_lastTime', $currTime) #end #end From f646b8ac88e920422afcaf8e0aa061b6653b37a5 Mon Sep 17 00:00:00 2001 From: Fabian Pichler Date: Sat, 25 Jun 2022 13:51:39 +0200 Subject: [PATCH 2/6] update celendar-web to 5.6-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 169fc5aeb..28dc7793b 100644 --- a/pom.xml +++ b/pom.xml @@ -139,7 +139,7 @@ com.celements calendar-web - 5.5 + 5.6-SNAPSHOT war From 805b173191037ac24375ee4b29a60bd187b22289 Mon Sep 17 00:00:00 2001 From: Fabian Pichler Date: Sat, 25 Jun 2022 14:29:44 +0200 Subject: [PATCH 3/6] benchmarking --- src/main/webapp/templates/celMacros/benchmark.vm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/webapp/templates/celMacros/benchmark.vm b/src/main/webapp/templates/celMacros/benchmark.vm index dac15eb60..f22b0cd26 100644 --- a/src/main/webapp/templates/celMacros/benchmark.vm +++ b/src/main/webapp/templates/celMacros/benchmark.vm @@ -13,11 +13,14 @@ $services.celementsweb.setGlobalContextValue('bench_lastTime', $bench_startTime) #set($currTime = $datetool.date.time) #set($bench_startTime = $services.celementsweb.getGlobalContextValue('bench_startTime')) #set($bench_lastTime = $services.celementsweb.getGlobalContextValue('bench_lastTime')) + #set($bench_outStrings = $services.celementsweb.getGlobalContextValue('bench_outString')) #set($totalTime = ($currTime - $bench_startTime) / 1000.0) #set($time = ($currTime - $bench_lastTime) / 1000.0) #if(!$visible) #end + $services.celementsweb.setGlobalContextValue('bench_outString', []) $services.celementsweb.setGlobalContextValue('bench_lastTime', $currTime) #end #end From 06cec73c0812ac0e4f0ae0d0e025cf80be1d42e7 Mon Sep 17 00:00:00 2001 From: Fabian Pichler Date: Sat, 25 Jun 2022 14:30:47 +0200 Subject: [PATCH 4/6] benchmarking --- src/main/webapp/templates/celMacros/benchmark.vm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/templates/celMacros/benchmark.vm b/src/main/webapp/templates/celMacros/benchmark.vm index f22b0cd26..1a209546f 100644 --- a/src/main/webapp/templates/celMacros/benchmark.vm +++ b/src/main/webapp/templates/celMacros/benchmark.vm @@ -16,9 +16,9 @@ $services.celementsweb.setGlobalContextValue('bench_lastTime', $bench_startTime) #set($bench_outStrings = $services.celementsweb.getGlobalContextValue('bench_outString')) #set($totalTime = ($currTime - $bench_startTime) / 1000.0) #set($time = ($currTime - $bench_lastTime) / 1000.0) - #if(!$visible) #end $services.celementsweb.setGlobalContextValue('bench_outString', []) $services.celementsweb.setGlobalContextValue('bench_lastTime', $currTime) From afbae1d8b973b0d5020407664982268eaf2e35bc Mon Sep 17 00:00:00 2001 From: Fabian Pichler Date: Sun, 26 Jun 2022 08:40:33 +0200 Subject: [PATCH 5/6] replace benchmark.vm with benchmark service --- pom.xml | 5 ++++ .../webapp/templates/celMacros/benchmark.vm | 26 ------------------- .../templates/celMacros/debug/queryexec.vm | 6 ++--- 3 files changed, 8 insertions(+), 29 deletions(-) delete mode 100644 src/main/webapp/templates/celMacros/benchmark.vm diff --git a/pom.xml b/pom.xml index 28dc7793b..6a09259da 100644 --- a/pom.xml +++ b/pom.xml @@ -162,6 +162,11 @@ + + com.celements + celements-performance + 5.0-SNAPSHOT + com.celements celements-commons diff --git a/src/main/webapp/templates/celMacros/benchmark.vm b/src/main/webapp/templates/celMacros/benchmark.vm deleted file mode 100644 index 1a209546f..000000000 --- a/src/main/webapp/templates/celMacros/benchmark.vm +++ /dev/null @@ -1,26 +0,0 @@ -## usage: parsing the template will start the benchmark and set the start time -## using the macro #bench will print the time since last call and total time since start -## only works for super admins -## INPUT label to distinguish time printouts - -#set($bench_startTime = $datetool.date.time) -$services.celementsweb.setGlobalContextValue('bench_startTime', $bench_startTime) -$services.celementsweb.setGlobalContextValue('bench_lastTime', $bench_startTime) - -#macro(bench $label $visible) -#if($isSuperAdmin) - #set($visible = $visible || ("$!request.showBenchmark" == 'true')) - #set($currTime = $datetool.date.time) - #set($bench_startTime = $services.celementsweb.getGlobalContextValue('bench_startTime')) - #set($bench_lastTime = $services.celementsweb.getGlobalContextValue('bench_lastTime')) - #set($bench_outStrings = $services.celementsweb.getGlobalContextValue('bench_outString')) - #set($totalTime = ($currTime - $bench_startTime) / 1000.0) - #set($time = ($currTime - $bench_lastTime) / 1000.0) - #if(!$visible) #end - $services.celementsweb.setGlobalContextValue('bench_outString', []) - $services.celementsweb.setGlobalContextValue('bench_lastTime', $currTime) -#end -#end diff --git a/src/main/webapp/templates/celMacros/debug/queryexec.vm b/src/main/webapp/templates/celMacros/debug/queryexec.vm index 5c5725b6e..91c28f502 100644 --- a/src/main/webapp/templates/celMacros/debug/queryexec.vm +++ b/src/main/webapp/templates/celMacros/debug/queryexec.vm @@ -41,9 +41,9 @@

${query.language}-query$query.statement

limit: $limit — printLimit: $printLimit

- #parse('celMacros/benchmark.vm') ## start benchmark + $services.bench.startBench() #set($result = $query.execute()) -

#bench('query execution time' true)

+

$services.bench.benchAndPrint('query execution time', true)

result count: $result.size() #if($limit > 0 && $result.size() >= $limit) (limited) #end


#if(!$noResultList) @@ -65,7 +65,7 @@ #end
-

#bench('printing result list' true)

+

$services.bench.benchAndPrint('printing result list', true)

#end ## noResultList #end ## ("$!query" == '') From f006de65a92ff7602ff0f4db3f8d231834a1f9e9 Mon Sep 17 00:00:00 2001 From: Fabian Pichler Date: Mon, 27 Jun 2022 17:52:42 +0200 Subject: [PATCH 6/6] update celements-search dependency --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6a09259da..ef6c97d60 100644 --- a/pom.xml +++ b/pom.xml @@ -210,7 +210,7 @@ com.celements celements-search - 5.3 + 5.4-SNAPSHOT com.celements