Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoggingHandler inefficient #154

Open
oli-h opened this issue Jul 14, 2017 · 0 comments
Open

LoggingHandler inefficient #154

oli-h opened this issue Jul 14, 2017 · 0 comments

Comments

@oli-h
Copy link
Contributor

oli-h commented Jul 14, 2017

When using the RequestLog feature, then for every request passing through a Gateleen server a new Instance of class org.swisspush.gateleen.logging.LoggingHandler is instanciated.
The constructor of this class does a lot of stuff over and over again which could be done 'just once' (or only once when the logging configuration changes).
Examples:

  • Iterate over the entries of each LoggingFilter and move the "url" key to the head of a list
  • LoggingFilters are kept only in a HashMap. Accessing entries in a HashMap is more expensive than it would be with a concrete object
  • There are a few "equalsIgnoreCase" String comparisons which is expensive in Java
  • All RegExps in the LoggingFilters are compiled (java.util.regex.Pattern.compile(...)) over and over again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants