Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 359824

Summary: Cache the INode model
Product: [Modeling] TMF Reporter: Mark Christiaens <mark.g.j.christiaens>
Component: XtextAssignee: Jan Koehnlein <jan>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: hendrik, jan, lieven.lemiengre, sebastian.zarnekow, tmf.xtext-inbox
Version: 2.1.0Flags: sebastian.zarnekow: juno+
Target Milestone: M7   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch to support EMF and INode model caching
none
Patch to update Xtext with basic support to marshall the node model
none
cleaned patch
none
cleaned patch
sebastian.zarnekow: iplog+
Patch without ISerializationService & DefaultSerializationService sebastian.zarnekow: iplog+

Description Mark Christiaens CLA 2011-10-04 07:45:15 EDT
Build Identifier: 20110615-0604

This patch provides an implementation of the infrastructure to cache the EMF and the INode models.  Caching these models allows you to load a resource from the cache instead of parsing the source code again.  In our product, this code results in loading a resource around 4 times faster (if both the EMF and INode model are required).  

See org.eclipse.xtext.modelcache.CacheTest for an illustrative unit test.  

Reproducible: Always
Comment 1 Mark Christiaens CLA 2011-10-04 07:46:59 EDT
Created attachment 204504 [details]
Patch to support EMF and INode model caching

This is a patch against rev. 5a7287712012ad3f53839bdabfc244955e0e990d
Comment 2 Sebastian Zarnekow CLA 2012-03-07 17:49:28 EST
Preliminary scheduled for m6.

For now we should just go for the serialization support for the node model. This allows clients to apply an own caching strategy / use your support code from github. The generic EMF model caching leaves too many open ends when it comes to derived state aware resources.

Could you please update the patch accordingly?
Comment 3 Mark Christiaens CLA 2012-03-08 16:31:28 EST
Created attachment 212336 [details]
Patch to update Xtext with basic support to marshall the node model

Path against Xtext head rev. 039b9a800666687c677f4202ec84641ac7b4b8af
Comment 4 Sebastian Zarnekow CLA 2012-03-08 16:36:12 EST
Mark, 

thanks for the updated patch.
At a first glance it contains classes like Cache, ProfilingClusteringBuilderState et al. Those shouldn't be necessary to serialize the node model, are they?
Comment 5 Sebastian Zarnekow CLA 2012-03-12 13:54:37 EDT
(In reply to comment #4)
> Mark, 
> 
> thanks for the updated patch.
> At a first glance it contains classes like Cache,
> ProfilingClusteringBuilderState et al. Those shouldn't be necessary to
> serialize the node model, are they?

Mark, did I miss something obvious here?
Comment 6 Lieven Lemiengre CLA 2012-03-13 09:06:59 EDT
I'm taking over from Mark.
I expect to have a clean patch ready by tomorow
Comment 7 Sebastian Zarnekow CLA 2012-03-13 09:09:00 EDT
Great news, Lieven. Looking forward to the patch.
Comment 8 Lieven Lemiengre CLA 2012-03-14 05:55:45 EDT
Created attachment 212630 [details]
cleaned patch
Comment 9 Sebastian Zarnekow CLA 2012-03-15 13:10:30 EDT
Lieven, thanks for the updated patch. Unfortunately it still contains code for the caching itself. Please see comment #2. We should only extend the node model to allow serialization / deserialization. The caching itself should be up to the client for now. If I'm not mistaken, only the node infrastructure is currently too closed for the client world to allow a caching strategy as described thus only this part of the framework should be affected by the patch. 

Please let me know if I misunderstood something.
Comment 10 Lieven Lemiengre CLA 2012-03-16 06:21:29 EDT
Created attachment 212778 [details]
cleaned patch

This is a patch with only the node serialization.
Comment 11 Sebastian Zarnekow CLA 2012-03-16 17:34:27 EDT
Thanks, Lieven. I'm still not fond of the ISerializationService (especially the parameter- and return types, see here: https://github.com/mark-christiaens/xtext/issues/30) but I think we can go ahead with a second reviewer (any volunteers) and meanwhile file a CQ.
Comment 12 Lieven Lemiengre CLA 2012-03-21 05:23:36 EDT
(In reply to comment #11)
> Thanks, Lieven. I'm still not fond of the ISerializationService (especially the
> parameter- and return types, see here:
> https://github.com/mark-christiaens/xtext/issues/30) but I think we can go
> ahead with a second reviewer (any volunteers) and meanwhile file a CQ.

I think that I can remove the ISerializationService and DefaultSerializationService.
Comment 13 Lieven Lemiengre CLA 2012-03-21 05:41:42 EDT
Created attachment 212979 [details]
Patch without ISerializationService & DefaultSerializationService
Comment 14 Sebastian Zarnekow CLA 2012-04-03 10:57:52 EDT
CQ filed: http://dev.eclipse.org/ipzilla/show_bug.cgi?id=6405

Mark, Lieven, could you please comment on this bugzilla according to http://www.eclipse.org/tm/development/committer_howto.php#external_contrib
Comment 15 Lieven Lemiengre CLA 2012-04-03 11:10:54 EDT
I, Lieven Lemiengre, declare that I developed attached code from scratch,
without referencing any 3rd party materials except material licensed under the
EPL. I am authorized by my employer to make this contribution under the EPL.
Comment 16 Mark Christiaens CLA 2012-04-06 09:22:44 EDT
I, Mark Christiaens, declare that I developed attached code from scratch,
without referencing any 3rd party materials except material licensed under the
EPL. I am authorized by my employer to make this contribution under the EPL.
Comment 17 Jan Koehnlein CLA 2012-04-20 06:43:20 EDT
Applied patch. Thanks a lot.

I marked the new serialize API as internal.
Comment 18 Eclipse Webmaster CLA 2017-10-31 10:47:00 EDT
Requested via bug 522520.

-M.
Comment 19 Eclipse Webmaster CLA 2017-10-31 10:58:13 EDT
Requested via bug 522520.

-M.