tinkerpop/blueprints — pull request #211 by konrade (2012-01-31 10:29:49+00:00)
Title: Some TinkerIndex optimization

Howdy,

I realized that having large indexes in the TinkerGraph implementation was strangely slow when query them.
It seems to be due to that each element set that a index hold gets copied every time it's asked for just to be iterated later.
By caching a return set/list this speeds up consecutive queries towards the index.
This would create a chance for ConcurrentModificationException if several threads access the index simultaneously and one of the threads uses remote() on the returned iterator.
It doesn't seems like the TinkerGraph implementation is thought to be thread-safe anyway so potentially the index query could be further speeded up by not even copying the element set once.

Cheers,
Konrad