forked from TrueCloudLab/distribution
853e2e92d8
(*App).context, called in the HTTP handler on each request, creates a URLBuilder, which involves calling Router(). This shows up in profiles a hot spot because it involves compiling the regexps which define all the routes. For efficiency, cache the router and return the same object each time. It appears to be safe to reuse the router because GetRoute is the only method ever called on the returned router object. Signed-off-by: Aaron Lehmann <alehmann@netflix.com> |
||
---|---|---|
.. | ||
descriptors.go | ||
doc.go | ||
errors.go | ||
fuzz.go | ||
headerparser.go | ||
headerparser_test.go | ||
routes.go | ||
routes_test.go | ||
urls.go | ||
urls_test.go |