[GitHub] tinkerpop issue #948: Optimizes Map with enum using the EnumMap implementati...

2018-10-04 Thread spmallette
Github user spmallette commented on the issue:

https://github.com/apache/tinkerpop/pull/948
  
merged to all release branches - thanks @otaviojava 


---


[GitHub] tinkerpop issue #948: Optimizes Map with enum using the EnumMap implementati...

2018-10-04 Thread spmallette
Github user spmallette commented on the issue:

https://github.com/apache/tinkerpop/pull/948
  
All tests pass with `docker/build.sh -t -n -i`

VOTE +1


---


[GitHub] tinkerpop issue #948: Optimizes Map with enum using the EnumMap implementati...

2018-10-04 Thread robertdale
Github user robertdale commented on the issue:

https://github.com/apache/tinkerpop/pull/948
  
VOTE +1


---


[GitHub] tinkerpop issue #948: Optimizes Map with enum using the EnumMap implementati...

2018-10-03 Thread dkuppitz
Github user dkuppitz commented on the issue:

https://github.com/apache/tinkerpop/pull/948
  
That's the kind of benchmark I was looking for. I don't think it needs to 
be part of the project (these micro-benchmarks always seem to be too unstable 
and making them part of the test suite usually just makes the builds fail at 
some point) - thus a manual test is good enough.

VOTE + 1


---


[GitHub] tinkerpop issue #948: Optimizes Map with enum using the EnumMap implementati...

2018-10-03 Thread otaviojava
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(__.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(__.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(__.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(__.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(__.bothE("created").has("weight", 32));

[GitHub] tinkerpop issue #948: Optimizes Map with enum using the EnumMap implementati...

2018-10-03 Thread dkuppitz
Github user dkuppitz commented on the issue:

https://github.com/apache/tinkerpop/pull/948
  
Although this looks like a very reasonable change and I don't have any 
objections, could you please run some benchmarks to show what we gain by this 
change?


---