Menu

#5 TagLink constructor message massive performance impact

open
nobody
None
5
2010-04-20
2010-04-20
Anonymous
No

The (misspelled) performance message "WARNING - this metric is not recomended for fast processing..." is causing a massive performance issue when used in a multithreaded environment.

If several threads each create TagLink algorithm instance, they create contention for the System.out PrintStream which queues all the threads behind each other until the performance message is output.

I have moved (and spellchecked!) the warning to a static block so it is only output when the class is loaded, and not on every construction and I have a 10 times performance improvement. I have also made the code stricter around the use of generics to avoid unneccessary casts.

The irony is not lost on me that a message warning of poor performance is such a massive bottleneck!

Discussion


Log in to post a comment.

MongoDB Logo MongoDB