-
Notifications
You must be signed in to change notification settings - Fork 122
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
Optimise all the things #100
Comments
I have noticed that you have recently removed scala-logging as a dependency. If you are using slf4j directly, then it will have worse performance than scala-logging. The main reason is that scala-logging (and other logging libraries) usually use an inbuilt macro that will only log if a certain logging level is enabled, i.e. if your log level is If you still want to use slf4j directly, then it may be useful to implement a macro so that calls to |
What the scala-logging macro did was rewrite code like this: logger.info("yolo") into code like this: if (logger.isInfoEnabled) {
logger.info("yolo")
} When I removed scala-logging, I just went through the codebase and manually rewrote all the logging calls to look like the latter. It's a bit boilerplate-y, but ScalaCache doesn't do logging in that many places. It wasn't painful enough to make me want to write a macro. However, you're right that it would be nice to avoid the call to |
I can do this in #103 If you wish |
…f within the function. Attempt to improve performance cb372#100
As we discovered in #82, ScalaCache has quite a high overhead compared to accessing the underlying cache directly. Let's see what we can do to improve this.
The text was updated successfully, but these errors were encountered: