Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » emf.ecore.resource.ResourceSet.getResource takes more time in VIRGO(emf.ecore.resource.ResourceSet.getResource takes more time in VIRGO)
emf.ecore.resource.ResourceSet.getResource takes more time in VIRGO [message #1182591] Tue, 12 November 2013 09:33 Go to next message
Chandre Gowda is currently offline Chandre GowdaFriend
Messages: 56
Registered: April 2013
Member
The following code takes around 1 second for every call in VIRGO server. But takes few milliseconds during eclipse run.

Resource resource = org.eclipse.emf.ecore.resource.ResourceSet.getResource(uri, true);

Any suggestions on how to debug this or performance optimization.
Re: emf.ecore.resource.ResourceSet.getResource takes more time in VIRGO [message #1182633 is a reply to message #1182591] Tue, 12 November 2013 10:03 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
In the past some resource lookups in Virgo have been slow because of the existence of a bundle with a large number of imports. See http://www.eclipse.org/virgo/profiling/ for profiling tools to help debug this.
Re: emf.ecore.resource.ResourceSet.getResource takes more time in VIRGO [message #1184306 is a reply to message #1182633] Wed, 13 November 2013 11:06 Go to previous messageGo to next message
Chandre Gowda is currently offline Chandre GowdaFriend
Messages: 56
Registered: April 2013
Member
Thanks for the reply.I have used 'YOURKIT" tool to profile this application. I found that ResourceSet.getResource(uri, true) statement takes around 1 second everytime. Also this bundle has lesser number of (around 10 packages)imports which i dont think cause bundle to slow down. Is there any optimization required for org.eclipse.emf.ecore.resource..?
Re: emf.ecore.resource.ResourceSet.getResource takes more time in VIRGO [message #1184346 is a reply to message #1184306] Wed, 13 November 2013 11:39 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
I doubt it. You'll need to analyse the YourKit profiling data to work out why it's taking so long. Please look into the call sequence and find out where this is spending the bulk of its time.
Re: emf.ecore.resource.ResourceSet.getResource takes more time in VIRGO [message #1184736 is a reply to message #1182591] Wed, 13 November 2013 16:59 Go to previous messageGo to next message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1341
Registered: July 2009
Senior Member
Chandre,

It is interesting that you see such a big difference between dev and deployment scenario. Eclipse resources can be anything so it would be helpful to have some more context here. Like if it's a straight xml resource coming form a plugin path it could be a class loading issue, but otherwise it might be a straightforwad network or filesystem difference, etc.. There are a number of things you can do to improve loading time for generic resources, including using the BinaryResource implementation, but yeah, that doesn't explain the huge performance discrepancy.

cheers,

Miles
Re: emf.ecore.resource.ResourceSet.getResource takes more time in VIRGO [message #1193897 is a reply to message #1184736] Mon, 18 November 2013 08:23 Go to previous messageGo to next message
Chandre Gowda is currently offline Chandre GowdaFriend
Messages: 56
Registered: April 2013
Member
Thanks for the feedback.
Actually following line is taking time(i.e around 1.5 sec) .
resourceSet.getResource(uri, true). The 'uri' is path to simple xml file.
The code snippet as below
	        if (resourceSet == null) {
			resourceSet = new ResourceSetImpl();
		}
		resourceSet.getPackageRegistry().put(namespaceURI, ePackage);
		resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, resourceFactory);
		URI uri = URI.createFileURI(file.getAbsolutePath());
		Resource resource = resourceSet.getResource(uri, true);
		return resource;



Thanks
Chandru
Re: emf.ecore.resource.ResourceSet.getResource takes more time in VIRGO [message #1198639 is a reply to message #1193897] Wed, 20 November 2013 12:35 Go to previous message
Chandre Gowda is currently offline Chandre GowdaFriend
Messages: 56
Registered: April 2013
Member
Hello,

After some analysis, I found that if I add the resource loading logic in my Activator, the time taken is much much less (~0.4 sec). However if I add it in one my bundles which gets called upon a request from the webUI, it takes 3 times more.

What I could infer was that while installing the bundle the time taken to load the resource is much less than when invoked when the complete application is up and running.

Does anybody have any idea what am I missing here ? Thanks for help

Thanks,
Chandru
Previous Topic:Refreshed Virgo Buildpack
Next Topic:Help about Install Virgo Snaps
Goto Forum:
  


Current Time: Thu Apr 25 17:11:23 GMT 2024

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

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

Back to the top