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

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

Github user dkuppitz commented on the issue:

    https://github.com/apache/tinkerpop/pull/621
  
    That's weird, this test works for me consistently.
    
    This is the test code:
    ```
    found = 0;
    for (final String line : traversal.explain().prettyPrint(160).split("]\n")) 
{ // need to split cause of word wrap
        if (line.contains("IncidentToAdjacentStrategy") && 
line.contains("[VertexStep(IN,vertex)"))
            found++;
        if (line.contains("IncidentToAdjacentStrategy") && 
line.contains("[VertexStep(OUT,vertex)"))
            found++;
        if (line.contains("AdjacentToIncidentStrategy") && 
line.contains("[VertexStep(BOTH,edge)"))
            found++;
        if (line.contains("CountStrategy") && 
line.contains("RangeGlobalStep(0,3)"))
            found++;
    }
    assertEquals(4, found);
    ```
    
    And this is the result of `prettyPrint()`:
    ```
    Traversal Explanation
    
=============================================================================================================================================================
    Original Traversal                    [VertexStep(OUT,edge), 
EdgeVertexStep(IN), GroupStep([VertexStep(IN,edge), EdgeVertexStep(OUT), 
GroupCountStep([VertexS
                                             tep(BOTH,vertex), CountGlobalStep, 
IsStep(gt(2))])],[FoldStep])]
    
    ConnectiveStrategy              [D]   [VertexStep(OUT,edge), 
EdgeVertexStep(IN), GroupStep([VertexStep(IN,edge), EdgeVertexStep(OUT), 
GroupCountStep([VertexS
                                             tep(BOTH,vertex), CountGlobalStep, 
IsStep(gt(2))])],[FoldStep])]
    RepeatUnrollStrategy            [O]   [VertexStep(OUT,edge), 
EdgeVertexStep(IN), GroupStep([VertexStep(IN,edge), EdgeVertexStep(OUT), 
GroupCountStep([VertexS
                                             tep(BOTH,vertex), CountGlobalStep, 
IsStep(gt(2))])],[FoldStep])]
    ByModulatorOptimizationStrategy [O]   [VertexStep(OUT,edge), 
EdgeVertexStep(IN), GroupStep([VertexStep(IN,edge), EdgeVertexStep(OUT), 
GroupCountStep([VertexS
                                             tep(BOTH,vertex), CountGlobalStep, 
IsStep(gt(2))])],[FoldStep])]
    MatchPredicateStrategy          [O]   [VertexStep(OUT,edge), 
EdgeVertexStep(IN), GroupStep([VertexStep(IN,edge), EdgeVertexStep(OUT), 
GroupCountStep([VertexS
                                             tep(BOTH,vertex), CountGlobalStep, 
IsStep(gt(2))])],[FoldStep])]
    FilterRankingStrategy           [O]   [VertexStep(OUT,edge), 
EdgeVertexStep(IN), GroupStep([VertexStep(IN,edge), EdgeVertexStep(OUT), 
GroupCountStep([VertexS
                                             tep(BOTH,vertex), CountGlobalStep, 
IsStep(gt(2))])],[FoldStep])]
    InlineFilterStrategy            [O]   [VertexStep(OUT,edge), 
EdgeVertexStep(IN), GroupStep([VertexStep(IN,edge), EdgeVertexStep(OUT), 
GroupCountStep([VertexS
                                             tep(BOTH,vertex), CountGlobalStep, 
IsStep(gt(2))])],[FoldStep])]
    IncidentToAdjacentStrategy      [O]   [VertexStep(OUT,vertex), 
GroupStep([VertexStep(IN,vertex), GroupCountStep([VertexStep(BOTH,vertex), 
CountGlobalStep, Is
                                             Step(gt(2))])],[FoldStep])]
    AdjacentToIncidentStrategy      [O]   [VertexStep(OUT,vertex), 
GroupStep([VertexStep(IN,vertex), GroupCountStep([VertexStep(BOTH,edge), 
CountGlobalStep, IsSt
                                             ep(gt(2))])],[FoldStep])]
    CountStrategy                   [O]   [VertexStep(OUT,vertex), 
GroupStep([VertexStep(IN,vertex), GroupCountStep([VertexStep(BOTH,edge), 
RangeGlobalStep(0,3),
                                              CountGlobalStep, 
IsStep(gt(2))])],[FoldStep])]
    PathRetractionStrategy          [O]   [VertexStep(OUT,vertex), 
GroupStep([VertexStep(IN,vertex), GroupCountStep([VertexStep(BOTH,edge), 
RangeGlobalStep(0,3),
                                              CountGlobalStep, 
IsStep(gt(2))])],[FoldStep])]
    LazyBarrierStrategy             [O]   [VertexStep(OUT,vertex), 
GroupStep([VertexStep(IN,vertex), GroupCountStep([VertexStep(BOTH,edge), 
RangeGlobalStep(0,3),
                                              CountGlobalStep, 
IsStep(gt(2))])],[FoldStep])]
    ProfileStrategy                 [F]   [VertexStep(OUT,vertex), 
GroupStep([VertexStep(IN,vertex), GroupCountStep([VertexStep(BOTH,edge), 
RangeGlobalStep(0,3),
                                              CountGlobalStep, 
IsStep(gt(2))])],[FoldStep])]
    StandardVerificationStrategy    [V]   [VertexStep(OUT,vertex), 
GroupStep([VertexStep(IN,vertex), GroupCountStep([VertexStep(BOTH,edge), 
RangeGlobalStep(0,3),
                                              CountGlobalStep, 
IsStep(gt(2))])],[FoldStep])]
    
    Final Traversal                       [VertexStep(OUT,vertex), 
GroupStep([VertexStep(IN,vertex), GroupCountStep([VertexStep(BOTH,edge), 
RangeGlobalStep(0,3),
                                              CountGlobalStep, 
IsStep(gt(2))])],[FoldStep])]
    ```
    
    Looks all good to me.


> by-modulator optimization strategy
> ----------------------------------
>
>                 Key: TINKERPOP-1682
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1682
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.2.4
>            Reporter: Daniel Kuppitz
>            Assignee: Daniel Kuppitz
>            Priority: Major
>
> The can be a significant difference in performance depending on whether you 
> use {{by(id)}} or {{by(id())}}:
> {noformat}
> gremlin> g.V().out().in().path().by(id()).profile()
> ==>Traversal Metrics
> Step                                                               Count  
> Traversers       Time (ms)    % Dur
> =============================================================================================================
> TinkerGraphStep(vertex,[])                                             6      
>      6          12.137    58.03
> VertexStep(OUT,vertex)                                                 6      
>      6           1.345     6.43
> VertexStep(IN,vertex)                                                 12      
>     12           0.861     4.12
> PathStep([[IdStep, ProfileStep]])                                     12      
>     12           6.570    31.42
>   IdStep                                                              36      
>     36           0.452
>                                             >TOTAL                     -      
>      -          20.916        -
> gremlin> g.V().out().in().path().by(id).profile()
> ==>Traversal Metrics
> Step                                                               Count  
> Traversers       Time (ms)    % Dur
> =============================================================================================================
> TinkerGraphStep(vertex,[])                                             6      
>      6           0.876    11.54
> VertexStep(OUT,vertex)                                                 6      
>      6           0.714     9.40
> VertexStep(IN,vertex)                                                 12      
>     12           3.299    43.43
> PathStep([id])                                                        12      
>     12           2.706    35.63
>                                             >TOTAL                     -      
>      -           7.596        -
> {noformat}
> We should have a strategy that rewrites these simple patterns. This affects 
> {{id()}}, {{label()}}, {{key()}}, {{value()}}, but also 
> {{by(values("name"))}}, which can be rewritten as {{by("name")}}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to