Home » Modeling » EMF » Unexpected meta-model reloading improvement
|
Re: Unexpected meta-model reloading improvement [message #981136 is a reply to message #981119] |
Mon, 12 November 2012 07:20 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Ed,<br>
<br>
Comments below.<br>
<br>
<div class="moz-cite-prefix">On 12/11/2012 8:00 AM, Ed Willink
wrote:<br>
</div>
<blockquote cite="mid:k7q6qg$6oe$1@xxxxxxxxe.org" type="cite">Hi
Ed
<br>
<br>
For Helios, in
<a class="moz-txt-link-freetext" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=315034">https://bugs.eclipse.org/bugs/show_bug.cgi?id=315034</a>, I reported
that the Sample Reflective Editor did not reload changed
meta-models. You responded that eClass is deliberately not proxy
resolving and so WONTFIXed.
<br>
<br>
Now with Juno/post-Juno I'm noticing that meta-models do reload.
<br>
</blockquote>
Yes, they reload and always have.<br>
<blockquote cite="mid:k7q6qg$6oe$1@xxxxxxxxe.org" type="cite">
<br>
Great. What's the underlying change, and does it need to be
propagated to other tooling?
<br>
</blockquote>
I think what you're noticing is this specialization:<br>
<br>
protected static final List<String> NON_DYNAMIC_EXTENSIONS =
Arrays.asList(new String [] { "xcore", "emof", "ecore", "genmodel"
});<br>
<br>
<blockquote> protected void handleActivate()<br>
{<br>
if (removedResources.isEmpty() &&
!changedResources.isEmpty())<br>
{<br>
for (Resource resource :
editingDomain.getResourceSet().getResources())<br>
{<br>
if (!changedResources.contains(resource))<br>
{<br>
URI uri = resource.getURI();<br>
if (!"java".equals(uri.scheme()) &&
!NON_DYNAMIC_EXTENSIONS.contains(uri.fileExtension()))<br>
{<br>
for (Iterator<EObject> i =
resource.getAllContents(); i.hasNext(); )<br>
{<br>
EObject eObject = i.next();<br>
if
(changedResources.contains(eObject.eClass().eResource()))<br>
{<br>
changedResources.add(resource);<br>
break;<br>
}<br>
}<br>
}<br>
}<br>
}<br>
}<br>
handleActivateGen();<br>
}<br>
</blockquote>
So basically we walk all objects of all resources that are not
sources of models themselves, and check if their model is a model
that's being reloaded and then add that resource to the set of
changed resources so that it too is unloaded and reloaded. If the
editor is dirty, you'll have to choose to throw your changes away.<br>
<br>
Note that there is still no resolving of EObject.eClass() so that
bugzilla continues to be a won't fix.<br>
<blockquote cite="mid:k7q6qg$6oe$1@xxxxxxxxe.org" type="cite">
<br>
Regards
<br>
<br>
Ed Willink
<br>
</blockquote>
<br>
</body>
</html>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Unexpected meta-model reloading improvement [message #981153 is a reply to message #981136] |
Mon, 12 November 2012 07:38 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
HI
Thanks. That helps me, but suddenly I wonder if this is one of the "e4"
problems, particularly the reported issues with slow tab-switching and
flickering for XML editors (e.g
https://bugs.eclipse.org/bugs/show_bug.cgi?id=385272#c195).
It seems that tab-switching will call handleActivate() which if the
ResourceSet is large could burn a lot of CPU probably on the UI thread.
Regards
Ed Willink
On 12/11/2012 07:20, Ed Merks wrote:
> Ed,
>
> Comments below.
>
> On 12/11/2012 8:00 AM, Ed Willink wrote:
>> Hi Ed
>>
>> For Helios, in https://bugs.eclipse.org/bugs/show_bug.cgi?id=315034,
>> I reported that the Sample Reflective Editor did not reload changed
>> meta-models. You responded that eClass is deliberately not proxy
>> resolving and so WONTFIXed.
>>
>> Now with Juno/post-Juno I'm noticing that meta-models do reload.
> Yes, they reload and always have.
>>
>> Great. What's the underlying change, and does it need to be
>> propagated to other tooling?
> I think what you're noticing is this specialization:
>
> protected static final List<String> NON_DYNAMIC_EXTENSIONS =
> Arrays.asList(new String [] { "xcore", "emof", "ecore", "genmodel" });
>
> protected void handleActivate()
> {
> if (removedResources.isEmpty() && !changedResources.isEmpty())
> {
> for (Resource resource :
> editingDomain.getResourceSet().getResources())
> {
> if (!changedResources.contains(resource))
> {
> URI uri = resource.getURI();
> if (!"java".equals(uri.scheme()) &&
> !NON_DYNAMIC_EXTENSIONS.contains(uri.fileExtension()))
> {
> for (Iterator<EObject> i = resource.getAllContents();
> i.hasNext(); )
> {
> EObject eObject = i.next();
> if
> (changedResources.contains(eObject.eClass().eResource()))
> {
> changedResources.add(resource);
> break;
> }
> }
> }
> }
> }
> }
> handleActivateGen();
> }
>
> So basically we walk all objects of all resources that are not sources
> of models themselves, and check if their model is a model that's being
> reloaded and then add that resource to the set of changed resources so
> that it too is unloaded and reloaded. If the editor is dirty, you'll
> have to choose to throw your changes away.
>
> Note that there is still no resolving of EObject.eClass() so that
> bugzilla continues to be a won't fix.
>>
>> Regards
>>
>> Ed Willink
>
|
|
|
Re: Unexpected meta-model reloading improvement [message #981186 is a reply to message #981153] |
Mon, 12 November 2012 08:13 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Ed,
Of course the logic only kicks in when there are changed resources,
i.e., resources in the resource set for which there have been deltas in
their underlying workspace IFile. It certainly won't cause XML editors
to flicker the toolbar (which is most likely caused by the extensive use
of property testers).
On 12/11/2012 8:38 AM, Ed Willink wrote:
> HI
>
> Thanks. That helps me, but suddenly I wonder if this is one of the
> "e4" problems, particularly the reported issues with slow
> tab-switching and flickering for XML editors (e.g
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=385272#c195).
>
> It seems that tab-switching will call handleActivate() which if the
> ResourceSet is large could burn a lot of CPU probably on the UI thread.
>
> Regards
>
> Ed Willink
>
>
> On 12/11/2012 07:20, Ed Merks wrote:
>> Ed,
>>
>> Comments below.
>>
>> On 12/11/2012 8:00 AM, Ed Willink wrote:
>>> Hi Ed
>>>
>>> For Helios, in https://bugs.eclipse.org/bugs/show_bug.cgi?id=315034,
>>> I reported that the Sample Reflective Editor did not reload changed
>>> meta-models. You responded that eClass is deliberately not proxy
>>> resolving and so WONTFIXed.
>>>
>>> Now with Juno/post-Juno I'm noticing that meta-models do reload.
>> Yes, they reload and always have.
>>>
>>> Great. What's the underlying change, and does it need to be
>>> propagated to other tooling?
>> I think what you're noticing is this specialization:
>>
>> protected static final List<String> NON_DYNAMIC_EXTENSIONS =
>> Arrays.asList(new String [] { "xcore", "emof", "ecore", "genmodel" });
>>
>> protected void handleActivate()
>> {
>> if (removedResources.isEmpty() && !changedResources.isEmpty())
>> {
>> for (Resource resource :
>> editingDomain.getResourceSet().getResources())
>> {
>> if (!changedResources.contains(resource))
>> {
>> URI uri = resource.getURI();
>> if (!"java".equals(uri.scheme()) &&
>> !NON_DYNAMIC_EXTENSIONS.contains(uri.fileExtension()))
>> {
>> for (Iterator<EObject> i = resource.getAllContents();
>> i.hasNext(); )
>> {
>> EObject eObject = i.next();
>> if
>> (changedResources.contains(eObject.eClass().eResource()))
>> {
>> changedResources.add(resource);
>> break;
>> }
>> }
>> }
>> }
>> }
>> }
>> handleActivateGen();
>> }
>>
>> So basically we walk all objects of all resources that are not
>> sources of models themselves, and check if their model is a model
>> that's being reloaded and then add that resource to the set of
>> changed resources so that it too is unloaded and reloaded. If the
>> editor is dirty, you'll have to choose to throw your changes away.
>>
>> Note that there is still no resolving of EObject.eClass() so that
>> bugzilla continues to be a won't fix.
>>>
>>> Regards
>>>
>>> Ed Willink
>>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Tue Apr 23 11:31:34 GMT 2024
Powered by FUDForum. Page generated in 0.03523 seconds
|