Github user otaviojava commented on the issue:

    https://github.com/apache/tinkerpop/pull/948
  
    @dkuppitz do you have any benchmarks that you in the project use?
    
    ```java
            for (int i = 0; i < 100; i++) {
                long start = System.currentTimeMillis();
                for (int index = 0; index < 100; index++) {
                    GraphFilter graphFilter = new GraphFilter();
                    assertFalse(graphFilter.hasEdgeFilter());
                    assertEquals(Collections.singleton(null), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.OUT));
                    assertEquals(Collections.singleton(null), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.IN));
                    assertEquals(Collections.singleton(null), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.BOTH));
                    //
                    graphFilter = new GraphFilter();
                    graphFilter.setEdgeFilter(__.outE("created"));
                    assertTrue(graphFilter.hasEdgeFilter());
                    assertEquals(Collections.singleton("created"), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.OUT));
                    assertEquals(Collections.emptySet(), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.IN));
                    assertEquals(Collections.emptySet(), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.BOTH));
                    //
                    graphFilter = new GraphFilter();
                    graphFilter.setEdgeFilter(__.outE());
                    assertTrue(graphFilter.hasEdgeFilter());
                    assertEquals(Collections.singleton(null), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.OUT));
                    assertEquals(Collections.emptySet(), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.IN));
                    assertEquals(Collections.emptySet(), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.BOTH));
                    //
                    graphFilter = new GraphFilter();
                    
graphFilter.setEdgeFilter(__.<Vertex>outE("created").has("weight", 32));
                    assertTrue(graphFilter.hasEdgeFilter());
                    assertEquals(Collections.singleton("created"), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.OUT));
                    assertEquals(Collections.emptySet(), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.IN));
                    assertEquals(Collections.emptySet(), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.BOTH));
                    //
                    graphFilter = new GraphFilter();
                    
graphFilter.setEdgeFilter(__.<Vertex>identity().outE("created"));
                    assertTrue(graphFilter.hasEdgeFilter());
                    assertEquals(Collections.singleton(null), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.OUT));
                    assertEquals(Collections.singleton(null), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.IN));
                    assertEquals(Collections.singleton(null), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.BOTH));
                    //
                    graphFilter = new GraphFilter();
                    graphFilter.setEdgeFilter(__.bothE());
                    assertTrue(graphFilter.hasEdgeFilter());
                    assertEquals(Collections.singleton(null), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.OUT));
                    assertEquals(Collections.singleton(null), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.IN));
                    assertEquals(Collections.singleton(null), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.BOTH));
                    //
                    graphFilter = new GraphFilter();
                    graphFilter.setEdgeFilter(__.<Vertex>bothE().has("weight", 
32));
                    assertTrue(graphFilter.hasEdgeFilter());
                    assertEquals(Collections.singleton(null), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.OUT));
                    assertEquals(Collections.singleton(null), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.IN));
                    assertEquals(Collections.singleton(null), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.BOTH));
                    //
                    graphFilter = new GraphFilter();
                    graphFilter.setEdgeFilter(__.<Vertex>bothE().limit(0));
                    assertTrue(graphFilter.hasEdgeFilter());
                    assertEquals(Collections.emptySet(), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.OUT));
                    assertEquals(Collections.emptySet(), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.IN));
                    assertEquals(Collections.emptySet(), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.BOTH));
                    //
                    graphFilter = new GraphFilter();
                    
graphFilter.setEdgeFilter(__.<Vertex>bothE("created").has("weight", 32));
                    assertTrue(graphFilter.hasEdgeFilter());
                    assertEquals(Collections.singleton("created"), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.OUT));
                    assertEquals(Collections.singleton("created"), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.IN));
                    assertEquals(Collections.singleton("created"), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.BOTH));
                    //
                    graphFilter = new GraphFilter();
                    graphFilter.setEdgeFilter(__.union(__.outE("created"), 
__.inE("likes")));
                    assertTrue(graphFilter.hasEdgeFilter());
                    assertEquals(Collections.singleton("created"), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.OUT));
                    assertEquals(Collections.singleton("likes"), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.IN));
                    assertEquals(Collections.emptySet(), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.BOTH));
                    //
                    graphFilter = new GraphFilter();
                    graphFilter.setEdgeFilter(__.union(__.outE("created"), 
__.inE("likes", "created")));
                    assertTrue(graphFilter.hasEdgeFilter());
                    assertEquals(Collections.singleton("created"), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.OUT));
                    assertEquals(new HashSet<>(Arrays.asList("likes", 
"created")), graphFilter.getLegallyPositiveEdgeLabels(Direction.IN));
                    assertEquals(Collections.singleton("created"), 
graphFilter.getLegallyPositiveEdgeLabels(Direction.BOTH));
                }
                long end = System.currentTimeMillis() - start;
                System.out.println(end);
            }
    ```
    
    ## EnumMap
    Minimum: 3
    Maximum: 35
    Range: 32
    Count: 99
    Mean: 7.646
    Median: 6
    Mode: 6
    
    ## HashMap
    
    Minimum: 6
    Maximum: 56
    Range: 53
    Count: 99
    Mean: 9.434
    Median: 9
    Mode: 8


---

Reply via email to