Developer's Diary
Software development, with Terry Ebdon
09-Mar-2019 Log config

Separate log configurations for test and main.

Changing log levels has a dramatic effect on the run time of a gradle check command. e.g. on an old & slow laptop it can vary between 28 seconds, at ERROR level, and over 4 minutes, at TRACE level. Separating the test and main log configuration will resolve this.

Log performance and noisiness should also need to be reviewed. It'd be better to use common logging configuration between test and main where possible.

Slow test

The test for TrekCalendarTest.testTick() is very slow. It just adds one to an integer and checks the result against TrekCalendar.tick(). Why does a simple test, involving only integer addition and comparison, take nearly 3.5 seconds to run?

image

This was due to TrekCalendar sub-classing LoggingBase. Removing the superfluous super class dramatically improved test performance.

image

06-MAR-2019 👈 Top of page 👉 10-MAR-2019

© 2020 Terry Ebdon.

Find me coding on GitHub, networking on LinkedIn, answering questions on Stack Exchange and hanging out on twitter.