Hi,

> JCR requires lookup of children by name and/or position (for orderable
> children), so the implementation needs to support all these cases
> efficiently.  The trickiest one to handle is probably Node.getNodes(String
> namePattern) because it requires using both name and position together.

While it's true that all that needs to be supported, I doubt that we
should try to optimize for all cases. Otherwise the normal case will
be slower.

Usually, there are not that many child nodes. In that case lookup is
not a problem: both a array and a hash map can be used (in memory).

If there are many child nodes, then we should try to optimize for the
most important case. I think it doesn't make sense to optimize for the
case that the long list (many thousand) children are manually
re-ordered (using orderBefore).

Regards,
Thomas

Reply via email to