Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Resource save performance
Resource save performance [message #421003] Mon, 21 July 2008 12:52 Go to next message
Maximilian Koegel is currently offline Maximilian KoegelFriend
Messages: 253
Registered: July 2009
Senior Member
Hi,
I am persisting a fairly big model with EMF using this code:

String fileName = <someFileName>;
URI fileURI = URI.createFileURI(fileName);
Resource resource = resourceSet.createResource(fileURI);

resource.getContents().add(<root_containing_all_other_elements >)

resourceSaveOptions = new HashMap<Object, Object>();
resourceSaveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED ,
Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
resource.save(resourceSaveOptions);


The model has about 20.000 instance with 5 to 10 features.
Saving takes a few seconds. This seems reasonable to me since the whole
file is rewritten, even if only one attribute in one instance might have
changed.
Is there any "smart" implementation, that updates existing
serializations instead of rewriting the whole file?
Is there anything else I can do to speed up serialization other than
splitting the model into several files (I already did that to some extend)?

Thanks,
Maximilian
Re: Resource save performance [message #421017 is a reply to message #421003] Mon, 21 July 2008 19:32 Go to previous message
David Steinberg is currently offline David SteinbergFriend
Messages: 489
Registered: July 2009
Senior Member
Hi Maximilian,

I'm not aware of any smart resource implementations that avoid rewriting
the whole file on save. I believe Ed did some prototyping on a more
efficient *load* implementation a couple of years ago, but my
recollection is that it languished in obscurity due to disinterest, and
I can't find any record of it anymore.

Cheers,
Dave


Maximilian Koegel wrote:
> Hi,
> I am persisting a fairly big model with EMF using this code:
>
> String fileName = <someFileName>;
> URI fileURI = URI.createFileURI(fileName);
> Resource resource = resourceSet.createResource(fileURI);
>
> resource.getContents().add(<root_containing_all_other_elements >)
>
> resourceSaveOptions = new HashMap<Object, Object>();
> resourceSaveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED ,
> Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
> resource.save(resourceSaveOptions);
>
>
> The model has about 20.000 instance with 5 to 10 features.
> Saving takes a few seconds. This seems reasonable to me since the whole
> file is rewritten, even if only one attribute in one instance might have
> changed.
> Is there any "smart" implementation, that updates existing
> serializations instead of rewriting the whole file?
> Is there anything else I can do to speed up serialization other than
> splitting the model into several files (I already did that to some extend)?
>
> Thanks,
> Maximilian
Previous Topic:Best way to copy element
Next Topic:[cdo] gmf in combination with cdo
Goto Forum:
  


Current Time: Thu Sep 26 00:31:20 GMT 2024

Powered by FUDForum. Page generated in 0.04253 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top