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

Bug or performance issue on InvocationFilter #586

Closed
mehdijk opened this issue Apr 17, 2016 · 1 comment
Closed

Bug or performance issue on InvocationFilter #586

mehdijk opened this issue Apr 17, 2016 · 1 comment

Comments

@mehdijk
Copy link

mehdijk commented Apr 17, 2016

Hi
I make a Spoon model for HSQLDB 1.8.0.9 and try to find invocation for some CtExecutable s . It works well for most of the items and it finds invocation list in 3-4 seconds. However for 3 methods, it takes so long and the invocation list is empty. The methods are:
public void org.hsqldb.util.DatabaseManagerSwing$StatementExecRunnable.run() takes 868 s
public void org.hsqldb.persist.LockFile$HeartbeatRunner.run() takes 111 s
void org.hsqldb.lib.HsqlTimer$Task.cancel() takes 89 s
This is my code:
List<CtInvocation<?>> invocationList = rootPack.getElements(new InvocationFilter(ctexe.getReference()));
Is there any bug or performance issue?

@GerardPaligot
Copy link
Contributor

Hi,

I confirm the performance issue. This is probably caused by the method CtExecutableReference#isOverriding which uses reflection when it is needed.

When you want to get all invocations of a CtMethod inside your source code, you don't need the reflection, so the performance is good.

But when you want all invocations of a method declared in a superclass which isn't present in the source classpath, you need to use the reflection for each CtExecutableReference of your project.

I have maybe a solution, I'll let you know.

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

No branches or pull requests

2 participants