Gleb Sinyavskiy created TINKERPOP-2855:
------------------------------------------

             Summary: Performance degradation in TinkerGraph 3.5.4
                 Key: TINKERPOP-2855
                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2855
             Project: TinkerPop
          Issue Type: Bug
          Components: tinkergraph
    Affects Versions: 3.5.4
         Environment: Ubuntu 22.04.1, docker
            Reporter: Gleb Sinyavskiy


Hello,

I few days ago I tried to update gremlin-server in our project from 3.5.3 to 
3.5.4 and found out that it's test suite got 5 times slower. We use the 
official docker image(tinkerpop/gremlin-server) with some configuration changes:
{code:java}
gremlin.tinkergraph.vertexIdManager=ANY
gremlin.tinkergraph.edgeIdManager=ANY {code}
The app uses user-generated string ids and heavily relies on the upsert pattern 
from the [recipes|https://tinkerpop.apache.org/docs/3.5.4/recipes/].

Yesterday I made an investigation and narrowed it down to the performance on 
the upsert pattern. I also discovered that the issue is not related to our 
configuration changes and can be reproduced with vanilla image and LONG ids.

I prepared a [simple script that reproduces the 
issue|https://github.com/zhulik/gremlin-server-performance-issue/] and 
contacted Stephen Mallette on discord. They confirmed the issue exists, but 
only in 3.5.4, 3.6.0 performs as expected. They also wrote a groovy script that 
reproduces the problem:
{code:groovy}
g = TinkerGraph.open().traversal()
batches = (0..<100).collect{ (0..<100) }
start = System.currentTimeMillis()
for (batch in batches) {
  b = g
  for (id in batch) {
    b = b.V(id).fold().coalesce(__.unfold(), __.addV("test").property(T.id, id))
  }
  b.iterate()
}
System.currentTimeMillis() - start
{code}
[discord 
message|https://discord.com/channels/838910279550238720/838910279550238723/1064964247823593502]

Both my and Stephen's scripts perform few times slower when executed against 
3.5.4 in compare to 3.5.3 or 3.6.0.

*Steps to reproduce:*

Run my or Stephen's script against vanilla tinkerpop/gremlin-server:3.5.4 
docker image

*Expected result:*

Script's execution time matches it's time executed against 3.5.3 or 3.6.0

*Observed result:*

Script is 5-7 times slower.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to