logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Brouwer <bruce.brou...@gmail.com>
Subject Some things I noticed with the Marker implementation
Date Tue, 22 Apr 2014 00:46:02 GMT
I saw that some small changes were being made to the Markers. I had a few
thoughts regarding them:

1) Use of array iterator instead of indexed for loop.
for (Marker marker : localParents)
instead of
for (int i = 0; i < localParents.length; i++)

When I was doing my performance benchmarks, I was finding the latter to be
faster. I'm guessing this is simply because a new Iterable object needs to
be created to iterate over the array.

For most methods, such as add, remove, this was not a big deal. But for the
isInstanceOf and checkParent methods, we want those to be as fast as
possible.

2) isInstanceOf(String markerName)
Instead of throwing an IllegalArgumentException when a marker of name
markerName doesn't exist, why don't we simply return false? I don't want an
IllegalArgumentException to happen because I'm testing a markerName.



-- 

Bruce Brouwer

Mime
View raw message