JCgH4164838Gh792C124B5 commented on pull request #504:
URL: https://github.com/apache/struts/pull/504#issuecomment-967794674


   Hi @davoustp.
   
   Thanks for producing this PR in response to the JIRA issue.  👍 The proposed 
change addresses the JIRA issue that was raised, by adding any expression/tree 
that can be "successfully parsed" to the expression cache.
   
   The original logic (prior to the change) would only add the expression/tree 
to the expression cache if the expression could be successfully executed (in 
addition to being "successfully parsed").  Looking at the history of `OgnlUtil` 
(as far back as I can see in the repository), it looks like the logic 
considered an expression "valid" to put in the expression cache if-and-only-if 
it could be successfully executed.  It seems like that may have been an 
intentional decision based on the original code comment ?
   
   There may be a trade-off in execution performance (by allowing more 
expressions to be considered "valid" and cached) and memory utilization (due to 
the larger number of potential expressions now being cached).
   
   It may be difficult to predict if the change in this PR might result in 
unexpected memory overhead, for some applications, due to potentially increased 
expression cache size.
   
   Having expressions considered "valid" if-and-only-if they can be executed 
successfully may have provided a limiting factor to keep the cache size more 
manageable in the past, but that is just my speculation.
   
   This change may be safer to attempt for the 2.6.x branch (as opposed to PR 
#503 for 2.5.x), since it introduces a new behaviour for the expression cache.
   
   Thoughts ?
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to