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.

Bug 125937 - ModelSource lookup implementation causing a UI freezes and poor application performance
Summary: ModelSource lookup implementation causing a UI freezes and poor application p...
Status: RESOLVED DUPLICATE of bug 134585
Alias: None
Product: xml
Classification: Unclassified
Component: XAM (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Samaresh Panda
URL:
Keywords:
Depends on:
Blocks: 126293
  Show dependency tree
 
Reported: 2008-01-24 16:54 UTC by Alexey Yarmolenko
Modified: 2009-02-19 23:31 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Yarmolenko 2008-01-24 16:54:32 UTC
Many users are reporting increased UI response time in BPEL diagram. This is a regression since September-November 2007
builds.  

My recent investigation showed that primary cause of this lags is incorrect model source implementation. Currently,
EVERY time we trying to find somethin in ModelSource's lookup, method  getLookup() defined at
org.netbeans.modules.xml.retriever.catalog.Utilities.java:632 is being called, which calls EditorCookie.openDocument(),
which in depth doing massive file system operations to determine encoding for current document. As a result a single
call to lookup() method can take up to 1000ms and even more. This is not acceptable because lookup() is being called
from XAMUtils.isWritable(model) method, which is being called very often.
Comment 1 Samaresh Panda 2008-01-24 17:30:00 UTC
This doesn't sound right. If there was any regression since September, we would have certainly come to know about it by
now. Your investigation sounds very inconclusive to me. In any case, I'll take a look. BTW, did you really mean you
found this in 5.0?
Comment 2 Samaresh Panda 2008-01-25 04:02:47 UTC
I have optimized this code. Please verify.
/cvs/xml/retriever/src/org/netbeans/modules/xml/retriever/catalog/Utilities.java,v  <--  Utilities.java
new revision: 1.11; previous revision: 1.10
Comment 3 Samaresh Panda 2008-01-25 04:05:52 UTC
This code was not touched in a long time so I suspect some other changes elsewhere could have caused what your users are
experiencing. In any case, this fix should help.
Comment 4 Alexey Yarmolenko 2008-01-25 11:44:06 UTC
My understanding is that this regression was introduced when NB folks added Encoding property to the project last
autumn. This function someway tries to build the list of roots for local file system and if you have any slow storage
attached to your machine, such as network disks or floppy drives, this function takes a long time to complete. We are
accessing this property indirectly when calling EditorCookie.openDocument() in _getDocument() function when construction
our lookup.

I will try your fix and report results shortly.
Comment 5 Alexey Yarmolenko 2008-01-30 17:38:17 UTC
Sam, fix does not solve the problem, because ModelSource is often used as short-living object, used just to access xam
model by given file object. So, caching lookup inside ModelSource does not make sense.

Also it caused P1 regression, please check 126293.



Comment 6 Samaresh Panda 2008-01-30 18:12:27 UTC
The fix was made based on your description, please read it carefully. I do not see any issues on schema nor wsdl side. I
suspect the usage of model source and models in bpel.

If this gets you to a regression, it tells me that there is some wrong usage on your side. In general the fix is good
and optimizes getLookup(). So this issue is technically fixed. Now you should find out why you're getting into a
regression and IMO the problem should be somewhere else.
Comment 7 Samaresh Panda 2008-01-30 18:41:49 UTC
The caching is good but I do see another issue here though. It keeps the document in the lookup which may lead to the
regression because each time the document in the lookup is same. Let me investigate further. The problem may as well be
in schema and wsdl.
Comment 8 Samaresh Panda 2008-01-30 20:36:21 UTC
Ok, this fix will not work. I'll revert it back, and in this case, the openDocument call remains a problem.
Comment 9 Samaresh Panda 2008-01-31 06:02:32 UTC
Reverted caching of lookup. See http://hg.netbeans.org/main?cmd=changeset;node=e0bcbd573fc1. Also I profiled the initial
issue that was reported but the openDocument() call in most cases measures few milliseconds. Please investigate further
on poor application performance and UI freezes. I'm marking this as wontfix.

Comment 10 Sergey Lunegov 2008-11-21 14:24:11 UTC
Sam, would you reconsider this issue in 7.0 ?
Comment 11 Samaresh Panda 2008-12-03 23:21:32 UTC
Refer to new issue 134585.

*** This issue has been marked as a duplicate of 134585 ***