playframework/Play20 — pull request #1090 by huntc (2013-05-03 12:19:00+00:00)
Title: Performance improvements

Following on from #1050.

After profiling with YourKit I noticed that there was a great deal of lock contention around logback. The following code was present:

Logger("play").debug...

...which would cause a lock to occur within Logback. The solution is to minimise the calls to Logger("play") by declaring a new "logger" property for the Play object that resolves to this logger. By using the property all locking contention is removed.

In addition a lazy value was being constructed during our Netty upstream handler. This was also causing a great deal of locking contention.

By applying these changes I have observed a 5% - 10% improvement across Play in general.

I have also provided an explicit instantiation of ForkJoinPool with our required configuration instead of relying on ExecutionContext to create one. By doing this the threads can also be once again named.