jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Bocanegra <tri...@apache.org>
Subject Paths in Oak
Date Fri, 01 Nov 2013 05:18:27 GMT

I debugged a simple call like:


and was really astonished how many path conversion, checking,
manipulation, tree/parent/child access operations are performed. not
only in access control, but everywhere. it looks like most of the
time, oak is busy converting, checking, truncating string paths :-)

for example, the NameParthMapperImpl.getOakPath()
- is overly complicated for the trivial case, where no namespaces
mappings are present
- creates extra object PathListener and many elements
- reconcatenates the path allthough it's still the original string
- truncates the last char

- PathUtils.isValid() / isAbsolute() is used very often.
- why check PathUtils.isValid() for a path that comes from the NamePathMapper

>From stepping though the code, it looks like the full path is not used
very often, but rather the individual segments. maybe it would make
sense to re-use jackrabbits Name and Path classes.

Further, getProperty().getString() actually fetches the property twice
and also checks access control twice. once in the getProperty() call,
and once when fetching the value. I would assume, that the value is
already stored in the PropertyState after the getProperty() call.

regards, toby

View raw message