Stefan Seifert wrote
> one thought i had when implementing SLING-6059 and SLING-6058 (resource and 
> property inheritance):
> 
> - currently both inheritance variants are switched off by default
> - they can be switched on by setting a special inherit property in the 
> configuration resource
> - this property can either be set on the "inner-most" configuration resource 
> matching the configuration path, or on anyone of the "outer" configuration 
> levels up to the fallback path in /conf/global, /apps/conf, /libs/conf.
> - thus it is possible to enable resource and/or property inheritance by 
> default for specific configuration names and keep it disabled for others. and 
> it is possible to "break inheritance" on any level if enabled globally.
> 
> all this flexible is not too complex to implement, but it comes at a cost: 
> for each configuration resource the whole configuration inheritance hierarchy 
> has to be searched for this special property if it is set to true. if yes, 
> the inheritance takes place. checking for the property is a cheap operations, 
> but still it leads to several additional resource accesses.
> 
> if we would remove the feature to allow this property to be set on any 
> hierarchy level, and only check for it on the last/inner-most configuration 
> level this it would be more performant to implement. but it would reduce the 
> features (no inheritance for all lower levels, no breaking of inheritance), 
> which would make it less flexible.
> 
> the problem is that even if the inheritance is never switched on anywhere, 
> still all the whole inheritance tree has to be checked. do we think this is a 
> performance problem?
> 

Lets assume we have
/conf/global/set/a
/conf/project/set/b
/conf/project/foo/set/c

and the context resource points to /conf/project/foo and you want all
children of "set", then I assume the inherit property is only changed on
/conf/project/foo/set. If that is false, nothing happens.
If it is true, it would be checked on /conf/project/set and if there is
one with true or if there is no property /conf/global/set is checked as
well.

If this understanding is correct, then if inheritance is not turned on,
the only performance impact is a single property check on the inner most
configuration resource. I think that is fine.

If inheritance is used, the performance impact is higher, but then I
think the impact of the inheritance itself is higher than the property
check. So I think we are fine there as well

 Regards

Carsten

-- 
Carsten Ziegeler
Adobe Research Switzerland
[email protected]

Reply via email to