[ 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 <<UNKNOWN>>, lang=Velocity2 Template Language <<UNKNOWN>> for script: DependentScriptWithMacros 2023-12-13 13:14:12,446 CET DEBUG: added VM dateCondition: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:12,870 CET DEBUG: added VM dateSearch: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:12,879 CET DEBUG: added VM numberCondition: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:13,794 CET DEBUG: added VM numberSearch: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:13,801 CET DEBUG: added VM checkboxCondition: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:14,603 CET DEBUG: added VM additionalSearch: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:14,609 CET DEBUG: added VM multiRefeConditionUpper: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:14,611 CET DEBUG: added VM multiRefeCondition: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,227 CET DEBUG: added VM MultiRefe: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,228 CET DEBUG: added VM where: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,243 CET DEBUG: added VM RefeSearchJoin: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,245 CET DEBUG: added VM addToJoinedSODateCodeList: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,253 CET DEBUG: added VM SelectSODate: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,260 CET DEBUG: added VM SelectMODate: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,267 CET DEBUG: added VM SelectIODate: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,275 CET DEBUG: added VM SelectTODate: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,282 CET DEBUG: added VM SelectOODate: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,288 CET DEBUG: added VM SelectCIODate: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,295 CET DEBUG: added VM joinSODate: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,300 CET DEBUG: added VM joinMODate: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,305 CET DEBUG: added VM joinIODate: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,310 CET DEBUG: added VM joinTODate: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,316 CET DEBUG: added VM joinOODate: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,321 CET DEBUG: added VM joinCollectiveInvoiceOpenDate: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,325 CET DEBUG: added VM addToJoinedMODateCodeList: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,330 CET DEBUG: added VM addToJoinedIOateCodeList: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,334 CET DEBUG: added VM addToJoinedTODateCodeList: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,339 CET DEBUG: added VM addToJoinedOODateCodeList: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,347 CET DEBUG: added VM addToJoinedCIOpenDateCodeList: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,351 CET DEBUG: added VM oDateCondition: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,352 CET DEBUG: added VM shFor: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,353 CET DEBUG: added VM shP: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,354 CET DEBUG: added VM joinShORWatchList: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,359 CET DEBUG: added VM spSearch: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,368 CET DEBUG: added VM shPAddSearch: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,369 CET DEBUG: added VM searchMFOPfirm: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,375 CET DEBUG: added VM mfPSearchJoin: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,383 CET DEBUG: added VM mfPSearch: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,391 CET DEBUG: added VM manPAddressSearch: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,395 CET DEBUG: added VM searchINVOPfirmany: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,401 CET DEBUG: added VM inPSearchJoin: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,407 CET DEBUG: added VM invPSearch: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,415 CET DEBUG: added VM invPAddSearch: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,416 CET DEBUG: added VM ValidStatusModes: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,418 CET DEBUG: added VM searchSHIPOPfirm: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,424 CET DEBUG: added VM shPSearchJoin: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,428 CET DEBUG: added VM iamSHIPOParfirm: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,430 CET DEBUG: added VM joinShAdd: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,433 CET DEBUG: added VM joinShOPfirmany: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,440 CET DEBUG: added VM joinShPos: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,447 CET DEBUG: added VM joinsheepArticle: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,449 CET DEBUG: added VM addShToMFjoin: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,465 CET DEBUG: added VM joinMfC: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,478 CET DEBUG: added VM joinMfA: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,485 CET DEBUG: added VM joinInToMan: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,488 CET DEBUG: added VM addInToManJoin: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,494 CET DEBUG: added VM generateAddressSearchConditions: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,496 CET DEBUG: added VM checkIfAddressSearch: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,504 CET DEBUG: added VM tsAddressSearch: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,505 CET DEBUG: added VM showOnlyActive: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,506 CET DEBUG: added VM SelectDG: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,520 CET DEBUG: added VM SelectAddress: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,541 CET DEBUG: added VM Selectfirmany: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,559 CET DEBUG: added VM SelectPartnerfirmany: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,576 CET DEBUG: added VM SelectPartnerAddress: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,594 CET DEBUG: added VM SelectMF: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,608 CET DEBUG: added VM SelectMfOpParfirm: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,621 CET DEBUG: added VM SelectMfOpParAddr: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,635 CET DEBUG: added VM SelectInvOpParfirmany: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,649 CET DEBUG: added VM SelectInvParAdd: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,663 CET DEBUG: added VM SelectCollInvfirmany: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,673 CET DEBUG: added VM SelectCollInvOpParAddress: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,676 CET DEBUG: added VM formatNumberByPrecition: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,690 CET DEBUG: added VM SelectOrdOpParfirmany: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,703 CET DEBUG: added VM SelectOrdPosOpParfirmany: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,717 CET DEBUG: added VM SelectOrdOpParAddress: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,731 CET DEBUG: added VM SelectOrdPosOpParAddress: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,744 CET DEBUG: added VM SelectTsOpParfirmany: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,765 CET DEBUG: added VM SelectTsOpParAddress: source=org.apache.velocity20.Template@1d46d6d9 2023-12-13 13:14:15,766 CET INFO : using engine=Velocity2 <<UNKNOWN>>, lang=Velocity2 Template Language <<UNKNOWN>> for script: MainScript 2023-12-13 13:14:15,766 CET DEBUG: Script [id = 2593271] successfully executed. time of execution: 3609 ms (where parsing the DependentScriptWithMacros script took approximately 3515 ms) ------------------------------------------------------------------------------------------------------------- > 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