[ 
https://issues.apache.org/jira/browse/TINKERPOP-1293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15280139#comment-15280139
 ] 

ASF GitHub Bot commented on TINKERPOP-1293:
-------------------------------------------

Github user okram commented on a diff in the pull request:

    https://github.com/apache/incubator-tinkerpop/pull/310#discussion_r62851083
  
    --- Diff: 
tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerGraphComputer.java
 ---
    @@ -54,6 +56,12 @@
      */
     public final class TinkerGraphComputer implements GraphComputer {
     
    +    static {
    +        // GraphFilters are expensive w/ TinkerGraphComputer as everything 
is already in memory
    --- End diff --
    
    `TinkerGraphComputer` already has the entire graph loaded in memory. Thus, 
when you add a `GraphFilter`, what I'm doing is creating a `Set<Object>` of 
edge IDs that are allowed. Then, every `Vertex.edges()` is filtered by 
`edge.id() in Set<Object>`. Its lame. As such, edge-based `GraphFilters` are 
expensive in `TinkerGraphComputer`.


> Implement GraphFilterStrategy as a default registration for GraphComputer
> -------------------------------------------------------------------------
>
>                 Key: TINKERPOP-1293
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1293
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.2.0-incubating
>            Reporter: Marko A. Rodriguez
>            Assignee: Marko A. Rodriguez
>             Fix For: 3.2.1
>
>
> {{GraphFilterStrategy}} would be a {{TraversalStrategy}} for 
> {{GraphComputers}}. It will inspect the {{Traversal}} and decide the 
> {{computer.vertices(...).edges(...)}} to use.
> Some rules:
> 1. If the traversal is part of an OLAP chain, don't apply strategy.
> 2. If the traversal is persist edges, then don't {{edges(...)}} or 
> {{vertices(...)}}.
> 3. If the traversal is persist vertex properties, then don't do 
> {{vertices(...)}}.
> Shouldn't be too difficult. Basically looking for:
> 1. {{VertexStep}} labels for edges.
> 2. {{HasStep}} containers for vertices and edges.
> From there, we can get fancy with {{outE().has("stars",gt(4))}}-style 
> {{edges(...)}}. However, basic element-label based filtering should be easy.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to