[
https://issues.apache.org/jira/browse/GROOVY-10934?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17691723#comment-17691723
]
Ken Hu commented on GROOVY-10934:
---------------------------------
The following script is able to reproduce the issue that I'm seeing. I was able
to run it through the groovysh from the binary distributions. Even though it
includes imports from Apache TinkerPop, I was able to run it without any Apache
TinkerPop libraries in the classpath. Please let me know if this isn't the case
for you.
{code:java}
import org.apache.tinkerpop.gremlin.structure.*
import org.apache.tinkerpop.gremlin.structure.util.*
import org.apache.tinkerpop.gremlin.process.traversal.*
import org.apache.tinkerpop.gremlin.process.traversal.step.*
import org.apache.tinkerpop.gremlin.process.traversal.step.util.*
import org.apache.tinkerpop.gremlin.process.remote.*
import org.apache.tinkerpop.gremlin.structure.util.empty.*
import org.apache.tinkerpop.gremlin.structure.io.*
import org.apache.commons.configuration2.builder.fluent.*
import org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.*
import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.*
import
org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.verification.*
import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.*
import org.apache.tinkerpop.gremlin.process.computer.clustering.connected.*
import org.apache.tinkerpop.gremlin.process.computer.clone.*
import org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.*
import org.apache.tinkerpop.gremlin.process.computer.traversal.*
import org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.*
import
org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.*
import org.apache.tinkerpop.gremlin.structure.VertexProperty.Cardinality.*
import org.apache.tinkerpop.gremlin.structure.Column.*
import org.apache.tinkerpop.gremlin.structure.Direction.*
import org.apache.tinkerpop.gremlin.process.traversal.Operator.*
import org.apache.tinkerpop.gremlin.process.traversal.Scope.*
import org.apache.tinkerpop.gremlin.structure.T.*
import
org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent.Pick.*
import org.apache.tinkerpop.gremlin.driver.*
import org.apache.tinkerpop.gremlin.driver.exception.*
import org.apache.tinkerpop.gremlin.driver.message.*
import org.apache.tinkerpop.gremlin.tinkergraph.structure.*
import org.apache.tinkerpop.gremlin.tinkergraph.process.computer.*
import static java.util.AbstractCollection.*
import static java.util.AbstractList.*
import static java.util.AbstractMap.*
import static java.util.AbstractMap.SimpleEntry.*
import static java.util.AbstractMap.SimpleImmutableEntry.*
import static java.util.Calendar.*
import static java.util.Calendar.Builder.*
import static java.util.Collections.*
import static java.util.Currency.*
import static java.util.HashSet.*
import static java.util.Hashtable.*
import static java.util.IdentityHashMap.*
import static java.util.IntSummaryStatistics.*
import static java.util.LinkedHashMap.*
import static java.util.LinkedHashSet.*
import static java.util.LinkedList.*
start = System.currentTimeMillis()
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
finish = System.currentTimeMillis()
finish - start
{code}
These are the times I got from running it with various versions:
3.0.4 --> 796 ms
3.0.5 --> 22305 ms
2.5.15 --> 1290 ms
2.5.17 --> 19374 ms
> Performance when Resolving Import Statement
> -------------------------------------------
>
> Key: GROOVY-10934
> URL: https://issues.apache.org/jira/browse/GROOVY-10934
> Project: Groovy
> Issue Type: Question
> Components: Groovysh
> Affects Versions: 3.0.5, 2.5.17
> Reporter: Ken Hu
> Priority: Major
>
> The time it takes to resolve imports for scripts seems to have increased
> substantially since fixing the issue for GROOVY-5103. This can have a major
> impact on performance when a simple script that contains many imports is
> executed because the majority of the time will be spent resolving the
> imports. Are there any workarounds for this?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)