[jira] [Commented] (TINKERPOP-1063) TinkerGraph performance enhancements

2016-06-30 Thread ASF GitHub Bot (JIRA)

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

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

Github user okram commented on the issue:

https://github.com/apache/tinkerpop/pull/342
  
Cool stuff. `Stream` is evil. It lurks throughout the codebase... Its 
funny, we were all gun ho for Java8, but we barely use it :(  VOTE +1.


> TinkerGraph performance enhancements
> 
>
> Key: TINKERPOP-1063
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1063
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: tinkergraph
>Affects Versions: 3.1.0-incubating
>Reporter: stephen mallette
>Assignee: stephen mallette
> Fix For: 3.1.3
>
>
> Improve TinkerGraph performance in relation to the Ferma Benchmark which 
> shows a reasonably wide gap between TP2 and TP3.  We probably won't achieve 
> parity with Blueprints but it would be nice to carve away some time to lessen 
> the gap.
> https://github.com/Syncleus/Ferma-benchmark



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


[jira] [Commented] (TINKERPOP-1063) TinkerGraph performance enhancements

2016-06-30 Thread ASF GitHub Bot (JIRA)

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

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

Github user dkuppitz commented on the issue:

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


> TinkerGraph performance enhancements
> 
>
> Key: TINKERPOP-1063
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1063
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: tinkergraph
>Affects Versions: 3.1.0-incubating
>Reporter: stephen mallette
>Assignee: stephen mallette
> Fix For: 3.1.3
>
>
> Improve TinkerGraph performance in relation to the Ferma Benchmark which 
> shows a reasonably wide gap between TP2 and TP3.  We probably won't achieve 
> parity with Blueprints but it would be nice to carve away some time to lessen 
> the gap.
> https://github.com/Syncleus/Ferma-benchmark



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


[jira] [Commented] (TINKERPOP-1063) TinkerGraph performance enhancements

2016-06-16 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/tinkerpop/pull/342#discussion_r67415317
  
--- Diff: 
tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
 ---
@@ -358,6 +350,14 @@ public Features features() {
 return features;
 }
 
+private void validateHomogenousIds(final List ids) {
+final Class firstClass = ids.get(0).getClass();
+for (Object id : ids) {
+if (!id.getClass().equals(firstClass))
+throw Graph.Exceptions.idArgsMustBeEitherIdOrElement();
+}
+}
+
--- End diff --

This opens the door for NPE's.

```
gremlin> graph.vertices("a", null, 1)
java.lang.NullPointerException
Display stack trace? [yN] y
java.lang.NullPointerException
at 
org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph.validateHomogenousIds(TinkerGraph.java:356)
at 
org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph.createElementIterator(TinkerGraph.java:329)
at 
org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph.vertices(TinkerGraph.java:269)
```

Suggestion with a few tweaks:

```
private void validateHomogenousIds(final List ids) {
final Iterator iterator = ids.iterator();
Object id = iterator.next();
if (id == null)
throw Graph.Exceptions.idArgsMustBeEitherIdOrElement();
final Class firstClass = id.getClass();
while (iterator.hasNext()) {
id = iterator.next();
if (id == null || !id.getClass().equals(firstClass))
throw Graph.Exceptions.idArgsMustBeEitherIdOrElement();
}
}
```


> TinkerGraph performance enhancements
> 
>
> Key: TINKERPOP-1063
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1063
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: tinkergraph
>Affects Versions: 3.1.0-incubating
>Reporter: stephen mallette
>Assignee: stephen mallette
> Fix For: 3.1.3
>
>
> Improve TinkerGraph performance in relation to the Ferma Benchmark which 
> shows a reasonably wide gap between TP2 and TP3.  We probably won't achieve 
> parity with Blueprints but it would be nice to carve away some time to lessen 
> the gap.
> https://github.com/Syncleus/Ferma-benchmark



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


[jira] [Commented] (TINKERPOP-1063) TinkerGraph performance enhancements

2016-06-16 Thread ASF GitHub Bot (JIRA)

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

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

GitHub user spmallette opened a pull request:

https://github.com/apache/tinkerpop/pull/342

TINKERPOP-1063 TinkerGraph Performance

https://issues.apache.org/jira/browse/TINKERPOP-1063

Got rid of `Stream` usage in TinkerGraph vertex/edge iteration.  Tests all 
pass with `mvn clean install`.

VOTE +1

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/tinkerpop TINKERPOP-1063

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tinkerpop/pull/342.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 #342


commit 70dd3245eadcf2dd69720c50fbffd3b0c9e92922
Author: Stephen Mallette 
Date:   2015-12-22T21:43:45Z

Improved performance of TinkerGraph around element lookup.

Primary change was to drop use of Stream and use IteratorUtils.

commit e59b93ca4ec7ffbde4a4b91319f35f5d3fd9caeb
Author: Stephen Mallette 
Date:   2016-06-16T19:08:30Z

Made TinkerGraph validate that ids be homogeneous up front.

Take this approach rather than doing it during iteration so that TinkerPop 
semantics are respected and appropriate validation exceptions are thrown at the 
right time.

commit 099e6bc62468516974a3e76531d00444dbe89edc
Author: Stephen Mallette 
Date:   2016-06-16T19:32:58Z

Updated changelog.




> TinkerGraph performance enhancements
> 
>
> Key: TINKERPOP-1063
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1063
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: tinkergraph
>Affects Versions: 3.1.0-incubating
>Reporter: stephen mallette
>Assignee: stephen mallette
> Fix For: 3.1.3
>
>
> Improve TinkerGraph performance in relation to the Ferma Benchmark which 
> shows a reasonably wide gap between TP2 and TP3.  We probably won't achieve 
> parity with Blueprints but it would be nice to carve away some time to lessen 
> the gap.
> https://github.com/Syncleus/Ferma-benchmark



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


[jira] [Commented] (TINKERPOP-1063) TinkerGraph performance enhancements

2016-06-16 Thread stephen mallette (JIRA)

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

stephen mallette commented on TINKERPOP-1063:
-

Ended up implementing the latter in the comment above - tests pass now.

> TinkerGraph performance enhancements
> 
>
> Key: TINKERPOP-1063
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1063
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: tinkergraph
>Affects Versions: 3.1.0-incubating
>Reporter: stephen mallette
>Assignee: stephen mallette
> Fix For: 3.1.3
>
>
> Improve TinkerGraph performance in relation to the Ferma Benchmark which 
> shows a reasonably wide gap between TP2 and TP3.  We probably won't achieve 
> parity with Blueprints but it would be nice to carve away some time to lessen 
> the gap.
> https://github.com/Syncleus/Ferma-benchmark



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