This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
We recently investigated performance issues on BPEL mapper and BPEL diagram and found that one of the major reasons for performance leaks is located in ModelSource lookup. This problem is mostly related to IZ125937, but this time I want to extend the problem scope and provide more scenarios, so I filed this new issue. So, 2 places, where we have performance problems are: 1. Get XAM model by given file object. 2. Get file object by given XAM model First one is called every time when reference resolver is trying to resolve cross-model reference. For example, this was a main cause for IZ130061. Second place is involved in scenarios, where we need to know read-only state of the model, such as enabling/disabling menu items, responding to DnD events and showing editors in property sheets. So, having slightest delays here also decreasing UI responsiveness a lot. So, basic solution I see here is again in area of improving ModelSource Lookup's performance. Profiling shows that now it suffers from timing of _getDocument() method. This method is called when we trying to query ModelSource lookup for ANY type of object, such as FileObject, DataObject, ModelAccessProvider. In issue 125937 we tried to avoid this by caching Document returned by _getDocument() method, but this created a regression around xml source and model synchronization. New proposed solution is to create lookup which will call _getDocument() ONLY WHEN lookup is queried for corresponding object type. All other objects, stored in lookup are constants and fixed lookup can be used to store them. This can be achieved with using AbstractLookup together with InstanceContent.Convertor for Document-type content. This lookup can be combined using ProxyLookup with fixed lookup, storing FileObject, DataObject and other constants. This should greatly reduce time required to query ModelSource lookup for FileObject and as a result, improve ModelSource cache performance. To provide further performance gains, we can add new utility method in ModelFactory, which will return Model by given FileObject. Additional caching of FileObject->Model pairs is requied to avoid querying ModelSource lookup completely. This utility method should try to find already loaded Model by given file object, and if not found, construct new ModelSource and call old method. This will also simplify a client code, because i found about 4 similar methods doing this only in BPEL editor module. All these helper methods can be removed in favor of this new ModelFactory method.
Can I see some profiler snapshots that points to performance leaks in modelsource creation and lookup? I mean how much time does it take? Do you have some tests/projects that I can run and see for myself? Also it seems like you have done some work on it already. Do you have a patch that I can try and see improvements?
Sam, we'd like this one to be implemented in 7.0.
*** Issue 125937 has been marked as a duplicate of this issue. ***
Let me ask again. Do you have some data to back the theory behind poor performance in ModelFacotory and ModelSource?
Updated priority appropriately.
The performance of Schema models was significantly improved with the fix for the issue #158236. But it relates to schema models only. And also the issue #158236 probably doesn't cover all problems are implied here. Unfortunately it isn't real to use the approach is used for #158236 in general case. It uses schema's specifics. I think this issue can be considered as an umbrella issue. More specific issues should be created to show particular use-case. Such issues should contain NetBeans projects to experiment with.
Do we still consider it as an umbrella ? If not please close as FIXED.