jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Mueller <muel...@adobe.com>
Subject Slow default methods in abstract classes
Date Thu, 06 Feb 2014 09:45:59 GMT
Hi,

We have some abstract classes that implement some methods for convenience.
For example, AbstractBlob.equals() is implemented by comparing all bytes
of a blob, which is very slow (OAK-1392). Or
AbstractNodeState.compareAgainstBaseState.

Because we forgot(?) to override those methods, we sometimes ended up with
very slow performance.

I would prefer if the implementations in the abstract classes are not
slow. Instead, I would prefer if such methods would be abstract or not
implemented (in the case of equals). If a "convenience" implementation is
useful, but slow, it should have a different name, for example
"equalsBruteForce" or
AbstractNodeState.compareAgainstBaseStateBruteForce(..).

That way, a non-abstract implementation could still use the default (slow)
implementation (for example for the in-memory case, or if the amount of
data is known to be small), but it would have to do that explicitly.

Regards,
Thomas


Mime
View raw message