You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by okram <gi...@git.apache.org> on 2016/09/13 19:35:51 UTC

[GitHub] tinkerpop pull request #411: TINKERPOP-14444: Benchmark bytecode->Traversal ...

GitHub user okram opened a pull request:

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

    TINKERPOP-14444: Benchmark bytecode->Traversal creation and implement GremlinServer cache if necessary.

    https://issues.apache.org/jira/browse/TINKERPOP-1444
    
    GremlinServer caching `Map<Bytecode,Traversal>` is only powerful (really powerful) when bindings are not involved (a solid 50x+ increase in speed). However, given that production systems will typically have bindings in their traversals, then such a cache doesn't help. 
    
    In its place, a update to `JavaTranslator` is provided that makes use of an internal static `METHOD_CACHE` so as to make reflection faster. The speed up is provided below:
    
    ```
    Prior to method caching:
      Bytecode->JavaTranslator call    : 0.13305238800000002
    After method caching:
      Bytecode->JavaTranslator call    : 0.054839154
    ```
    
    CHANGELOG
    
    ```
    * Added a static method cache to `JavaTranslator` to reduce the cost of Java reflection.
    ```
    
    @spmallette --- if you think that a `Map<Bytecode,Traversal>` cache IS necessary for GremlinServer,  then  please VOTE -1 and we can collaborate on this branch to also include a bytecode-cache.


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

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

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

    https://github.com/apache/tinkerpop/pull/411.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 #411
    
----
commit 2a2b59b15833d80587bb8127d6edfd38a17ab788
Author: Marko A. Rodriguez <ok...@gmail.com>
Date:   2016-09-13T19:23:32Z

    JavaTranslator now makes use of a static method cache. This speeds up Bytecode->JavaTranslator translation. From 0.098ms to 0.029ms. If a GremlinServer Bytecode cache is not desired, then, at minimum we should use this JavaTranslator update in its place.

commit ed8feea52e2055edcd45cd5c97f8ef3d60cc6820
Author: Marko A. Rodriguez <ok...@gmail.com>
Date:   2016-09-13T19:30:27Z

    removed this. from a static field name call. minor nothing.

commit 1fc52cb2d208fb0949e66f2e1cf2c1307495a537
Author: Marko A. Rodriguez <ok...@gmail.com>
Date:   2016-09-13T19:34:47Z

    reduced complexity by having a single GLOBAL_METHOD_CACHE for both Traversal and TraversalSource methods. Cleaner code with less instanceof stuff.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop issue #411: TINKERPOP-1444: Benchmark bytecode->Traversal creation...

Posted by spmallette <gi...@git.apache.org>.
Github user spmallette commented on the issue:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop issue #411: TINKERPOP-1444: Benchmark bytecode->Traversal creation...

Posted by dkuppitz <gi...@git.apache.org>.
Github user dkuppitz commented on the issue:

    https://github.com/apache/tinkerpop/pull/411
  
    All good, here's the missing
    
    VOTE: +1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop pull request #411: TINKERPOP-1444: Benchmark bytecode->Traversal c...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop issue #411: TINKERPOP-14444: Benchmark bytecode->Traversal creatio...

Posted by spmallette <gi...@git.apache.org>.
Github user spmallette commented on the issue:

    https://github.com/apache/tinkerpop/pull/411
  
    I'm thinking that the cache hit count would be pretty low given the fact that bytecode contains parameters. since the hit count will be low, we'll just have the overhead of a cache without much value. it would be sweet if we could decouple the traversal from parameters so that a cache would be more effective, but i don't know what's involved with that offhand.  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---