Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
During profiling of tapestry framework I found that HashMap is actively used in following code:
NamedSet.java
public void eachValue(Worker<T> worker)
{
F.flow(getValues()).each(worker);
}
Here HashSet (which internally uses HashMap) is created inside getValues() only to iterate over it.
I changed code to use ArrayList instead of HashSet.
With following patch time per request decreased on 3.5 ms (7.4% of overall time). Measurements were done with apache benchmark on a real application after warm up phase.