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 131442 - XML Schema code completion autopopup slows down the editor
Summary: XML Schema code completion autopopup slows down the editor
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Samaresh Panda
URL:
Keywords:
Depends on: 131451
Blocks:
  Show dependency tree
 
Reported: 2008-03-28 18:03 UTC by Andrei Badea
Modified: 2008-07-16 20:50 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dumps (68.43 KB, text/plain)
2008-03-28 18:04 UTC, Andrei Badea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Badea 2008-03-28 18:03:24 UTC
Create a new empty XML document. Paste the following into it:

-----%<-----
<?xml version='1.0' encoding='UTF-8'?>
<xfaces-config version="1.2" 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">

|

</xfaces-config>
-----%<-----

Type a character at the caret position (marked by "|"). As soon as "Please wait" pops up, continue to type quickly. The
CPU will stay at 100% while you type, and the drawing of the typed text will be sluggish. If you type enough characters,
the high CPU activity continues even after you stop typing.

I am attaching three thread dumps which seem to imply that the culprit is the XML schema code completion. Apart from
being slow, it tries to pop up automatically too often. Disabling the XML schema code completion module seems to fix the
problem.

I have seen KitsTrackerImpl.updateAndGet() very often in the thread dumps, not sure if that is normal behavior, so
cc'ing Vita.
Comment 1 Andrei Badea 2008-03-28 18:04:26 UTC
Created attachment 59303 [details]
Thread dumps
Comment 2 Samaresh Panda 2008-03-28 18:28:06 UTC
This is strange, because I have not made any changes in the CC module that will cause this regression. I believe this
has been caused by some underlying changes elsewhere. Anyway, let me take a look...
Comment 3 Andrei Badea 2008-03-28 18:46:41 UTC
It is quite possible. I am getting the same behavior even when the XML schema CC is disabled. I have new stack traces,
so I will file another issue against the editor.

Still, XML schema CC autopopup does slow down the editor noticeably. For example, it activates even if I type whitespace
-- I can see the "Please wait" popup being disabled for at least a second. The editor is quite faster when the XML
schema CC module is disabled.
Comment 4 Andrei Badea 2008-03-28 18:55:28 UTC
Filed also issue 131451.
Comment 5 Samaresh Panda 2008-03-29 01:36:47 UTC
I'm not sure where the problem is. I tried this with build 200803230003 and 200803241203 and I do not see any issue
there. Seems like a recent change is causing this regression and I do see the sluggish behavior in any xml not just schemas.
Comment 6 Samaresh Panda 2008-03-29 15:51:28 UTC
On a fresh build from source, it looks better, however, my performance tests are not showing any improvement.
Comment 7 tonybeckham 2008-03-31 17:05:36 UTC
I am able to reproduce the high CPU usage while typing characters while "please wait..." is displayed but they are not
drawn slowly.  Also, even after typing a lot of characters CPU usage immediately returned to idle like state.

System info:
Product Version: NetBeans IDE Dev (Build 200803302302)
Java: 1.5.0_13; Java HotSpot(TM) Client VM 1.5.0_13-119
System: Mac OS X version 10.5.2 running on i386; MacRoman; en_US (nb) 
Comment 8 Samaresh Panda 2008-03-31 17:28:19 UTC
I guess the build doesn't have the fix for issue 131451. I just verified with a fresh source, this issue and issue
131451 has been fixed. Also my CC performance tests which regressed heavily (from ~8sec to ~80sec), came down to ~40sec
after my fix http://hg.netbeans.org/main?cmd=changeset;node=42d49de611e2 and it came down to ~4sec after issue 131451
was fixed.

I should rather say that, this issue depended on issue 131451.
Comment 9 tonybeckham 2008-07-16 20:50:12 UTC
Fix Verified

Product Version: NetBeans IDE Dev (Build 200807101204)
Java: 1.6.0_05; Java HotSpot(TM) 64-Bit Server VM 1.6.0_05-b13-52
System: Mac OS X version 10.5.4 running on x86_64; MacRoman; en_US (nb)