|
|
|
Re: How can I see the exact query EMF executes? [message #1853769 is a reply to message #1853753] |
Sun, 17 July 2022 16:19 |
I S Messages: 13 Registered: May 2022 |
Junior Member |
|
|
Hi Ed!
I tried to use my debugger and found that the for loop inside the crossReference() method (EcoreUtil class) is executing hundreds of thousands times (I used hit count in a breakpoint properties to count). What might it mean? What do you mean saying "flat model"? What might be my first step to solve this problem?
Sorry for too many question, just trying to understand how it works.
The full code of this method is below:
/**
* Compute the map of cross references.
*/
protected void crossReference()
{
for (TreeIterator<Notifier> contents = newContentsIterator(); contents.hasNext();)
{
Object content = contents.next();
if (content instanceof EObject)
{
EObject eObject = (EObject)content;
if (containment(eObject))
{
handleCrossReference(eObject);
}
else
{
contents.prune();
}
}
}
}
UPD:
I stopped with debugger inside newContentsIterator(). The code of it is:
protected TreeIterator<Notifier> newContentsIterator()
{
return new ContentTreeIterator<Notifier>(emfObjects);
}
I checked the size of emfObjects. The size is 1. So why is the for loop lopping and looping?
[Updated on: Sun, 17 July 2022 16:29] Report message to a moderator
|
|
|
Re: How can I see the exact query EMF executes? [message #1853771 is a reply to message #1853769] |
Sun, 17 July 2022 20:14 |
Ed Willink Messages: 7635 Registered: July 2009 |
Senior Member |
|
|
Hi
Quote:I checked the size of emfObjects. The size is 1. So why is the for loop lopping and looping?
No idea. Seems like a contradiction. But the debugger will help you understand.
NB. It is very common for loops to nest, so it could well be that the particular loop you are looking at is a loop of one. It is the product of all the loop counts that is probably the problem.
Regards
Ed Willink
[Updated on: Sun, 17 July 2022 20:34] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02220 seconds