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> |
||
---|---|---|
.. | ||
api | ||
auth | ||
client | ||
handlers | ||
listener | ||
middleware | ||
proxy | ||
storage | ||
doc.go | ||
registry.go | ||
registry_test.go | ||
root.go |