Friday, January 1, 2016

AspectJ for Java logging: Benchmarking aspect instrumentation - part 8

While preparing to introduce the Java logging Aspect covered in this series to a new project, I wanted to quantify the potential overhead in a formal way since my earlier exercises showed negligible impact but were not documented.

While searching for some sort of already existing benchmarking test, I came across this blog posting, which was not quite a formal benchmark, but had some well-written code that would fit my needs. A big thanks for the folks at Takipi for the effort in there.

The required modifications were simple, including the creation of a new test class matching the existing test hierarchy and then creation of a simple logging aspect to recreate the explicit logging call found in the other tests.

My merge request has not been accepted at the master branch as of this writing, but you can see the updated tree in my own branch of the fork at GitHub: https://github.com/nastacio/the-logging-olympics/tree/nastacio-aspectj.

The results showed no consistent impact, which is to be expected since the AspectJ compiler pretty much inserts the same bytecode you would get from typing the advice in the pointcut yourself.

No comments:

Post a Comment