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

Decrease number of operations with HashMap #2

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.4
    • 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.

      Attachments

        Activity

          People

            hlship Howard Lewis Ship
            mihasik Michael Mikhulya
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: