You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/03/06 18:40:00 UTC
[jira] [Commented] (TINKERPOP-1911) Refactor JavaTranslator to
cache all reflective calls
[ https://issues.apache.org/jira/browse/TINKERPOP-1911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16388277#comment-16388277 ]
ASF GitHub Bot commented on TINKERPOP-1911:
-------------------------------------------
GitHub user spmallette opened a pull request:
https://github.com/apache/tinkerpop/pull/812
TINKERPOP-1911 Refactored JavaTranslator
Cached methods that were being reflected on every translation which improved performance a bit. Here's how it runs before the change:
```text
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:
```text
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
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/tinkerpop TINKERPOP-1911
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tinkerpop/pull/812.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 #812
----
commit d9db27f4aa7b8227a557cf5bbb31203612d7548f
Author: Stephen Mallette <sp...@...>
Date: 2018-03-06T18:00:30Z
TINKERPOP-1911 Refactored JavaTranslator
Cached methods that were being reflected on every translation which improved performance a bit.
----
> Refactor JavaTranslator to cache all reflective calls
> -----------------------------------------------------
>
> Key: TINKERPOP-1911
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1911
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.2.7
> Reporter: stephen mallette
> Assignee: stephen mallette
> Priority: Major
>
> For some reason {{JavaTranslator}} still has some reflection calls in it that are called on every {{Bytecode}} translation. We should cache the results of those expensive methods.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)