Home » Modeling » Papyrus » Lag because of BuddyClassLoading during XWT Introspection
Lag because of BuddyClassLoading during XWT Introspection [message #1782649] |
Tue, 27 February 2018 11:41 |
Thorsten Schlathölter Messages: 312 Registered: February 2012 Location: Düsseldorf |
Senior Member |
|
|
Hi,
we have embedded Papyrus in our application an experience lags due to the properties view which uses XWT. During creation of the XWT tabs, XWT uses introspection to check for BeanInfo classes. Since papyrus makes uses of buddy class loading there is quite a number of bundles which is searched for these BeanInfo classes which probably don't even exist. The lag is quite annoying 20-40 seconds and it is freezing the ui because the class loading takes place in the UI thread.
Is this a known issue?
This is an example of a stack. I just stopped the UI thread during the lag. The class which the classloader is currently looking for is:
org.eclipse.papyrus.infra.properties.ui.widgets.AbstractMultiReferenceBeanInfo
EquinoxContainerAdaptor$1(ClassLoader).findClass(String) line: not available
EquinoxContainerAdaptor$1(ClassLoader).loadClass(String, boolean) line: not available
EquinoxContainerAdaptor$1(ClassLoader).loadClass(String) line: not available
BundleLoader.findClassInternal(String, boolean) line: 479
BundleLoader.findClass(String, boolean) line: 395
BundleLoader.findClass(String) line: 387
DependentPolicy.loadClass(String) line: 55
PolicyHandler.doBuddyClassLoading(String) line: 141
BundleLoader.findClassInternal(String, boolean) line: 471
BundleLoader.findClass(String, boolean) line: 395
BundleLoader.findClass(String) line: 387
DependentPolicy.loadClass(String) line: 55
PolicyHandler.doBuddyClassLoading(String) line: 141
BundleLoader.findClassInternal(String, boolean) line: 471
BundleLoader.findClass(String, boolean) line: 395
BundleLoader.findClass(String) line: 387
EquinoxClassLoader(ModuleClassLoader).loadClass(String, boolean) line: 150
EquinoxClassLoader(ClassLoader).loadClass(String) line: not available
Class<T>.forName0(String, boolean, ClassLoader, Class<?>) line: not available [native method]
Class<T>.forName(String, boolean, ClassLoader) line: not available
ClassFinder.findClass(String, ClassLoader) line: not available
BeanInfoFinder(InstanceFinder<T>).instantiate(Class<?>, String) line: not available
BeanInfoFinder(InstanceFinder<T>).find(Class<?>) line: not available
Introspector.findExplicitBeanInfo(Class<?>) line: not available
Introspector.<init>(Class<?>, Class<?>, int) line: not available
Introspector.getBeanInfo(Class<?>) line: not available
Introspector.getBeanInfo(Class<?>, Class<?>, int) line: not available
Introspector.<init>(Class<?>, Class<?>, int) line: not available
Introspector.getBeanInfo(Class<?>) line: not available
Metaclass(AbstractMetaclass).initialize(Class<?>, IMetaclass) line: 685
Metaclass(AbstractMetaclass).assertInitialize() line: 677
Metaclass(AbstractMetaclass).newInstance(Object[]) line: 395
ResourceLoader.doCreate(Object, Element, Class<?>, Map<String,Object>) line: 613
ResourceLoader.doCreate(Object, Element, Class<?>, Map<String,Object>) line: 717
ResourceLoader.doCreate(Object, Element, Class<?>, Map<String,Object>) line: 717
ResourceLoader.createUIElement(Element, Map<String,Object>) line: 378
PapyrusXWTCore(Core).createCLRElement(IRenderingContext, Element, Map<String,Object>) line: 630
PapyrusXWTCore(Core).load(ILoadingContext, InputStream, URL, Map<String,Object>) line: 772
PapyrusXWTCore(Core).load(ILoadingContext, URL, Map<String,Object>) line: 660
XWTLoader.loadWithOptions(URL, Map<String,Object>) line: 1072
Thanks in advance.
Regards,
Thorsten
|
|
| | |
Re: Lag because of BuddyClassLoading during XWT Introspection [message #1782669 is a reply to message #1782666] |
Tue, 27 February 2018 14:38 |
Camille Letavernier Messages: 952 Registered: February 2011 |
Senior Member |
|
|
Hi Thorsten,
That should be sufficient. You should make sure that you also get the latest version of XWT (Also from ~ 2017-12-xxx), but I believe the dependency to that latest version is explicitly specified, so that shouldn't be an issue.
So in theory:
- Many (expensive) calls from XWT to Class.getResource() should be simply skipped in the case of Papyrus, because we don't use *.xwt files next to Java classes
- The ClassLoader should be called only once per Java Class, because we maintain a Cache for each loaded class (Which Eclipse/OSGI don't do by default)
So the freeze should be less important than it used to be in Oxygen.0 (Due to the removed class.getResource() calls), and it should only happen a few times after loading Papyrus, and improve over time (Due to the added cache). If you experience the same freezes after reloading some properties pages, then there's definitely something wrong.
Once the cached class loaders are populated, displaying a properties page should take around 100-200ms, and definitely less than 1s (i.e. not 100% fluid but "good enough")
Camille Letavernier
|
|
| |
Goto Forum:
Current Time: Fri Mar 29 15:49:55 GMT 2024
Powered by FUDForum. Page generated in 0.06139 seconds
|