Bug #9835
The same rules files are loaded and compiled multiple times
0%
Related issues
History
#1 Updated by Octavian Adrian Gavril over 1 year ago
During a tags count in TRPL, it was found that many .rules files are loaded and compiled multiple times. This suggests a performance gap.
See #1745-27. Greg wrote:
I think we should be able to reuse the same loaded code in many places, though we will have to ensure that we fix usage of "global data" such that we don't rely upon any variable references outside of the current file-level scope. I wonder what performance improvement we can get by this.
#2 Updated by Octavian Adrian Gavril over 1 year ago
- Related to Feature #1745: review, decide upon and document the 1.0 features which will be retained in 2.0 added
#3 Updated by Octavian Adrian Gavril over 1 year ago
- Status changed from New to WIP
#4 Updated by Octavian Adrian Gavril over 1 year ago
I've started implementing a mechanism to prevent loading the same .rules file multiple times. While analyzing ConfigLoader, I noticed that caching firstRuleSet, lastRuleContainer, and lastNamedFunction helps maintain a processed state for the .rules file.
However, it looks like there may be other attributes that also need to be preserved to ensure things work correctly when the same file is used again in a different context. Right now, I'm running into some NPEs when expressions are being executed, likely due to missing context.
Would it be OK if I commit these changes directly to 1745a, or would you prefer I create a separate task branch? Keep in mind that 1745a is already using some maps to avoid duplicate logging, so it might make sense to keep the changes together.
#5 Updated by Greg Shah over 1 year ago
Yes, you can use 1745a.