Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TINKERPOP-1911 Refactored JavaTranslator #812

Merged
merged 1 commit into from Mar 12, 2018
Merged

TINKERPOP-1911 Refactored JavaTranslator #812

merged 1 commit into from Mar 12, 2018

Conversation

spmallette
Copy link
Contributor

@spmallette spmallette commented Mar 6, 2018

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

Cached methods that were being reflected on every translation which improved performance a bit. Here's how it runs before the change:

Benchmark                                             Mode  Cnt        Score        Error  Units
JavaTranslatorBenchmark.testTranslationLong          thrpt   20    13267.284 ±   1166.704  ops/s
JavaTranslatorBenchmark.testTranslationMedium        thrpt   20   334756.147 ±  23429.373  ops/s
JavaTranslatorBenchmark.testTranslationShort         thrpt   20  1381906.511 ± 141710.801  ops/s
JavaTranslatorBenchmark.testTranslationWithStrategy  thrpt   20    36350.729 ±  2518.351   ops/s

and here's how it runs after:

Benchmark                                             Mode  Cnt        Score       Error  Units
JavaTranslatorBenchmark.testTranslationLong          thrpt   20    15801.483 ±   546.613  ops/s
JavaTranslatorBenchmark.testTranslationMedium        thrpt   20   365673.060 ±  6101.193  ops/s
JavaTranslatorBenchmark.testTranslationShort         thrpt   20  1560609.216 ± 37680.931  ops/s
JavaTranslatorBenchmark.testTranslationWithStrategy  thrpt   20    39533.823 ±  1317.264  ops/s

Not a huge difference but seemed to be worth doing.

All tests pass with mvn clean install && mvn verify -pl gremlin-server -DskipIntegrationTests=false

VOTE +1

Cached methods that were being reflected on every translation which improved performance a bit.
@BrynCooke
Copy link
Contributor

+1 (Non binding)

@robertdale
Copy link
Member

What's the difference between the global method cache and the local method cache?

@spmallette
Copy link
Contributor Author

The local cache is specific to the GraphTraversalSource that's passed into the of() construction method. As the GraphTraversalSource is specific to the instance and is not known until construction I figured it was better if it were managed local to the JavaTranslator instance

@jorgebay
Copy link
Contributor

lgtm, VOTE +1

@asfgit asfgit merged commit d9db27f into tp32 Mar 12, 2018
@asfgit asfgit deleted the TINKERPOP-1911 branch April 14, 2018 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants