[
https://jira.jboss.org/jira/browse/JBSEAM-4244?page=com.atlassian.jira.pl...
]
Riccardo Serafin commented on JBSEAM-4244:
------------------------------------------
From:
http://www.seamframework.org/Community/212PerformanceRegressionInMessages
The problem is the following: I've been profiling my application and since I switched
to 2.1.2 I've noticed a huge amount of calls to Messages.AbstractMap.entrySet() and
the related performance problem, as this method creates the entry set recurring all
entries of all entry sets of the underlying properties maps. As a result, I get this
method as the first one in the profiler in terms of consumed time.
After looking at the code, I noticed that:
1) the implementation of containsKey that was included in 2.1.1 has been removed. This
implementation used the faster get() method instead of the slower entrySet() method, which
is used by the default AbstractMap implementation, to determine if the key is present.
2) The method resolveInMap in the SeamELResolver is now using a call to containsKey before
trying to access the value.
So, to test if my theory was correct, I've replaced the Messages class with my own,
which extends the default one and adds the containsKey implementation copied from 2.1.1.
Profiling results has gone back to "normal".
To test, I guess you can just try to profile the execution of a containsKey on the current
implementation, then put back the previous containsKey override and profile again. You
should be noticing the gain.
Related issues:
JBSEAM-2192 - This is the one where the containsKey fix was introduced.
JBSEAM-3916 - This is the one where the call to containsKey as been introduced in
SeamELResolver (which worsen the problems).
fix for JBSEAM-4131 introduced a performance regression
-------------------------------------------------------
Key: JBSEAM-4244
URL:
https://jira.jboss.org/jira/browse/JBSEAM-4244
Project: Seam
Issue Type: Bug
Components: Core
Reporter: Pete Muir
Assignee: Norman Richards
Fix For: 2.2.0.CR1
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira