See test scripts.
Testing initially focused on:
However, those do not appear to significantly impact performance. So the process of converting a looking up which node a proxy points to and converting the node reference to a URI seems like the most likely culprit (hence looking at acoburn:fcrepo-1957).seem to be the problem. The process is:
- List the children of a direct container and load each node.
- Load the node the proxyFor property points to.
- Convert the member node to a URI.
Each of these steps is reasonably fast (~1msec). But as the number of members grows, even 3 msec per member eventually adds up. For example, a collection with 10,000 members would take 30 seconds.
Some possible options for improving performance include:
- Caching nodes: this can improve the time to look up the member node and convert it to a URI.
- Using properties explicitly set on the collection object instead of proxies: this can eliminate the extra node lookup for loading the proxy node.
- Using Modeshape's internal query functionality: in theory this could be more efficient than iterating over the proxies. However, it appears that Modeshape uses the database as a document store, and so winds up loading all of the members anyway, with performance very similar to just iterating over all the children.