Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2335

Decrease number of operations with HashMap #2

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.4
    • Component/s: None
    • Labels:
      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.

        Attachments

          Activity

            People

            • Assignee:
              hlship Howard M. Lewis Ship
              Reporter:
              mihasik Michael Mikhulya
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: