|
Re: Resource save performance [message #421017 is a reply to message #421003] |
Mon, 21 July 2008 19:32 |
David Steinberg 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
|
|
|
Powered by
FUDForum. Page generated in 0.04253 seconds