GitHub user okram opened a pull request:
https://github.com/apache/tinkerpop/pull/476
TINKERPOP-1292: TinkerGraphComputer VertexProgramInterceptors
https://issues.apache.org/jira/browse/TINKERPOP-1292
Added `TinkerGraphCountStrategy` which will translate `g.V().count()` and
`g.E().count()` into direct calls to the underlying
`TinkerGraph.vertices/edges` hash maps (`.size()`). Thus, no need to iterate
out the vertices/edges and then count the iteration. O(1) time for count.
--- we can extend on this line of reasoning in this branch if people have
other ideas for shortcuts.
* Also did some cleanup of some test suites in Neo4jGraph and TinkerGraph
that should have been removed long ago when their respective strategy suites
were removed.
VOTE +1.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/tinkerpop TINKERPOP-1292
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tinkerpop/pull/476.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #476
----
commit 0ea3b5e26e76919d080fe224b1b727a132c4b829
Author: Marko A. Rodriguez <[email protected]>
Date: 2016-11-01T21:24:18Z
added TinkerCountGlobalStep and TinkerGraphCountStrategy which will turn
g.V().count() and g.E().count() into direct calls to the .size() of the
underlying TinkerGraph.vertices/edges Maps. Removed the OptIn strategy suites
in both TinkerGraph and Neo4jGraph -- this should have been done when these
suites were removed long ago.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---