Skip to content

TINKERPOP-1444: Benchmark bytecode->Traversal creation and implement GremlinServer cache if necessary.#411

Merged
asfgit merged 4 commits intomasterfrom
TINKERPOP-1444
Sep 15, 2016
Merged

TINKERPOP-1444: Benchmark bytecode->Traversal creation and implement GremlinServer cache if necessary.#411
asfgit merged 4 commits intomasterfrom
TINKERPOP-1444

Conversation

@okram
Copy link
Copy Markdown
Contributor

@okram okram commented Sep 13, 2016

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.

… 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.
…aversal and TraversalSource methods. Cleaner code with less instanceof stuff.
@spmallette
Copy link
Copy Markdown
Contributor

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.

@okram okram changed the title TINKERPOP-14444: Benchmark bytecode->Traversal creation and implement GremlinServer cache if necessary. TINKERPOP-1444: Benchmark bytecode->Traversal creation and implement GremlinServer cache if necessary. Sep 15, 2016
@asfgit asfgit merged commit c47217d into master Sep 15, 2016
@spmallette
Copy link
Copy Markdown
Contributor

VOTE +1

@dkuppitz
Copy link
Copy Markdown
Contributor

All good, here's the missing

VOTE: +1

@asfgit asfgit deleted the TINKERPOP-1444 branch November 1, 2016 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants