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

Improve performance of io.undertow.util.PathTemplateMatcher

XMLWordPrintable

      I noticed the following TODO in io.undertow.util.PathTemplateMatcher:

      TODO: we can probably do this faster using a trie type structure, but I think the current impl should perform ok most of the time

      The objective of this ticket is to develop a faster path template matcher / handler.  

      Initially I attempted to use a tree type structure to develop a faster router, but the code evolved into something a little more complex.  Basically the matcher - called router in order to temporarily run it side-by-side with the original matcher - consists of strategies that optimised to quickly match specific combinations of path segments.  

      Based on - admittedly rudimentary - performance benchmarks, the new version appears to be between 3 and 4 times faster than the previous version, depending on the number of paths that needs to be recognised.  

      There are one or two more minor improvements I would like to make before submitting a PR.

       

      PS: This is my first attempt at contributing towards this project, so there may be several things about contributing to this project that I don't know.  Feel free to point them out to me!

              rhn-cservice-bbaranow Bartosz Baranowski
              dirkroets@gmail.com Dirk Roets (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: