jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: Slow default methods in abstract classes
Date Mon, 10 Feb 2014 22:06:16 GMT
Hi,

On Thu, Feb 6, 2014 at 4:45 AM, Thomas Mueller <mueller@adobe.com> wrote:
> Because we forgot(?) to override those methods, we sometimes ended up with
> very slow performance.

The original purpose of the abstract classes and the generic,
unoptimized methods in them was to simplify experimentation and
initial implementations when the NodeStore API was being developed.
Nowadays they are mostly useful for correct handling of corner cases
for which no better/faster implementation is available, but you're
right in that it's often too easy to forget that a better
implementation is almost always needed for the normal use cases.

> If a "convenience" implementation is useful, but slow, it should have
> a different name, for example "equalsBruteForce" or
> AbstractNodeState.compareAgainstBaseStateBruteForce(..).

Sounds good. We still do need those methods for the purpose mentioned
above, but naming them more explicitly (or having them only as static
utility methods like we already do for many AbstractNodeState methods)
makes sense.

BR,

Jukka Zitting

Mime
View raw message