Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-2131

ContentEncodingRepository.getContentEncodings allocates many ArrayList iterators in hot path

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Minor Minor
    • 2.3.0.Final, 2.3.0.Alpha2
    • None
    • Core
    • None

      ContentEncodingRepository.getContentEncodings(HttpServerExchange) allocates many ArrayList iterators in hot paths for handling requests. It may be worthwhile to avoid using for-each loops and instead use old fashioned for loop with List.get(int) to avoid additional allocations during request processing.
       

      java.util.ArrayList$Itr
      at java.util.ArrayList.iterator()
      at java.util.AbstractCollection.addAll(Collection)
      at io.undertow.server.handlers.encoding.ContentEncodingRepository.getContentEncodings(HttpServerExchange)
      at io.undertow.server.handlers.encoding.EncodingHandler.handleRequest(HttpServerExchange)
       

       

              flaviarnn Flavia Rainone
              schlosna David Schlosnagle (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: