[jira] [Commented] (VELOCITY-969) Lower scripts parser performance after update from 1.6 to 2.3 velocity version

2023-12-18 Thread Magdalena Karpierz (Jira)


[ 
https://issues.apache.org/jira/browse/VELOCITY-969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17798141#comment-17798141
 ] 

Magdalena Karpierz commented on VELOCITY-969:
-

Below is an example that shows the difference in performance when parsing a 
script using velocity 1.6.3 and velocity 2.3. 
Parsed scripts are added as attachments:
We have a main script (MainScript) that basically does nothing (and does not 
call any macro from the DependentScriptWithMacros file in this example)  and a 
dependent large script with macros (DependentScriptWithMacros) that takes a 
long time to parse using Velocity 2.3.
Macros in this example don't do anything useful, but I just want to show what 
type of structures we're dealing with.

Is there anything that can be done to make velocity 2.3 parse this script at a 
similar speed to velocity 1.6.3 (maybe some properties configuration)  ? 

ps. I know that this script with macros is not optimally written, but we cannot 
change it (due to too many such scripts and tests related to such changes).

 

Below are logs from the execution of the same script (MainScript with a 
dependent script DependentScriptWithMacros) using velocity 1.6.3 and Velocity 
2.3

 logs from  velocity 1.6.3  -
2023-12-13 13:05:44,481 CET DEBUG: Init message received. Will execute script 
[id = 2593271, outputRequired=true, userLanguage=en ]
2023-12-13 13:05:44,481 CET DEBUG: Main scriptId = 2593271  dependent scripts = 
2593281, 2593271, 
2023-12-13 13:05:44,488 CET INFO : using engine=Velocity 1.6.3, lang=Velocity 
Template Language 1.6.3 for script: DependentScriptWithMacros
2023-12-13 13:05:44,548 CET INFO : using engine=Velocity 1.6.3, lang=Velocity 
Template Language 1.6.3 for script: MainScript
2023-12-13 13:05:44,550 CET DEBUG: Script [id = 2593271] successfully executed.
time of execution: 79 ms
--

- logs from  velocity 2.3 
2023-12-13 13:14:12,170 CET DEBUG: Init message received. Will execute script 
[id = 2593271, outputRequired=true, userLanguage=en ]
2023-12-13 13:14:12,170 CET DEBUG: Main scriptId = 2593271  dependent scripts = 
2593281, 2593271, 
2023-12-13 13:14:12,195 CET WARN : configuration key 'resource.loader' has been 
deprecated in favor of 'resource.loaders'
2023-12-13 13:14:12,195 CET DEBUG: Initializing Velocity, Calling init()...
2023-12-13 13:14:12,196 CET DEBUG: Starting Apache Velocity v2.3
2023-12-13 13:14:12,197 CET DEBUG: Default Properties resource: 
org/apache/velocity20/runtime/defaults/velocity.properties
2023-12-13 13:14:12,213 CET DEBUG: ResourceLoader instantiated: 
org.apache.velocity20.runtime.resource.loader.FileResourceLoader
2023-12-13 13:14:12,213 CET DEBUG: FileResourceLoader: adding path '.'
2023-12-13 13:14:12,214 CET DEBUG: initialized (class 
org.apache.velocity20.runtime.resource.ResourceCacheImpl) with class 
java.util.Collections$SynchronizedMap cache map.
2023-12-13 13:14:12,216 CET DEBUG: Loaded System Directive: 
org.apache.velocity20.runtime.directive.Stop
2023-12-13 13:14:12,217 CET DEBUG: Loaded System Directive: 
org.apache.velocity20.runtime.directive.Define
2023-12-13 13:14:12,217 CET DEBUG: Loaded System Directive: 
org.apache.velocity20.runtime.directive.Break
2023-12-13 13:14:12,218 CET DEBUG: Loaded System Directive: 
org.apache.velocity20.runtime.directive.Evaluate
2023-12-13 13:14:12,218 CET DEBUG: Loaded System Directive: 
org.apache.velocity20.runtime.directive.Macro
2023-12-13 13:14:12,219 CET DEBUG: Loaded System Directive: 
org.apache.velocity20.runtime.directive.Parse
2023-12-13 13:14:12,220 CET DEBUG: Loaded System Directive: 
org.apache.velocity20.runtime.directive.Include
2023-12-13 13:14:12,221 CET DEBUG: Loaded System Directive: 
org.apache.velocity20.runtime.directive.Foreach
2023-12-13 13:14:12,243 CET DEBUG: Created '1' parsers.
2023-12-13 13:14:12,248 CET DEBUG: "velocimacro.library.path" is not set. 
Trying default library: velocimacros.vtl
2023-12-13 13:14:12,250 CET DEBUG: Default library velocimacros.vtl not found. 
Trying old default library: VM_global_library.vm
2023-12-13 13:14:12,250 CET DEBUG: Old default library VM_global_library.vm not 
found.
2023-12-13 13:14:12,250 CET DEBUG: allowInline = true: VMs can be defined 
inline in templates
2023-12-13 13:14:12,250 CET DEBUG: allowInlineToOverride = false: VMs defined 
inline may NOT replace previous VM definitions
2023-12-13 13:14:12,250 CET DEBUG: allowInlineLocal = false: VMs defined inline 
will be global in scope if allowed.
2023-12-13 13:14:12,250 CET DEBUG: autoload off: VM system will not 
automatically reload global library macros
2023-12-13 13:14:12,250 CET INFO : using engine=Velocity2 <>, 
lang=Velocity2 Template Language <> for script: 
DependentScriptWithMacros
2023-12-13 13:14:12,446 CET DEBUG: added VM dateCondition: 
source=

[jira] [Updated] (VELOCITY-969) Lower scripts parser performance after update from 1.6 to 2.3 velocity version

2023-12-18 Thread Magdalena Karpierz (Jira)


 [ 
https://issues.apache.org/jira/browse/VELOCITY-969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Magdalena Karpierz updated VELOCITY-969:

Attachment: SampleScript.zip

> Lower scripts parser performance after update from 1.6 to 2.3 velocity version
> --
>
> Key: VELOCITY-969
> URL: https://issues.apache.org/jira/browse/VELOCITY-969
> Project: Velocity
>  Issue Type: Bug
>Reporter: Magdalena Karpierz
>Priority: Critical
> Attachments: SampleScript.zip
>
>
> Hello Team,
>  
> We have problems after update velocity 1.6.3 to 2.3 version with parsing 
> performance of the scripts which include many macros inside and overall 
> lenght of the script is about 3000 lines.
> Performance execution of this kind of scripts decreased 10 times, example 
> script execution in velocity1 took: 1sec. and in velocity2:  6 to 10 seconds.
>  
> Did You observe such performance issues?
> Can You suggest us a potential solution for this problem?
>  
> I prioritized this ticket as a critical, because our customers saw this 
> immediately  and it blocks some further activities.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org