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 134902

Summary: HgUtils.isIgnored is very slow
Product: versioncontrol Reporter: Jesse Glick <jglick>
Component: MercurialAssignee: issues@versioncontrol <issues>
Status: RESOLVED FIXED    
Severity: blocker CC: issues
Priority: P3 Keywords: PERFORMANCE, THREAD
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: proposed patch

Description Jesse Glick 2008-05-13 02:12:19 UTC
If you open any nb.org module project and expand its Source Packages or Unit Test Packages node in the Projects tab, the
IDE will freeze for a few seconds (blocking EQ) before they are displayed. Thread dumps reveal that the IDE is mostly
running HgUtils.isIgnored.

The block "we assume that the Project should not be ignored" not only has no basis in fact, but it seems to be
particularly slow. It should be deleted. The rest of the time seems to be spent running the pattern matcher.
Consolidating the regexps into a single one using '|' for alternation does not seem to help significantly.
Comment 1 Padraig Obriain 2008-05-13 14:01:25 UTC
I will remove the complained of block of code HgUtils.isIgnored.

A large number of the calls to HgUtils.isIgnored are caused by FileStatusCache.getCachedStatus called from
MercurialAnnotator.annotateIcon.

I believe that FileStatusCache.getCachedStatus should not be calling HgUtils.isIgnored. I have removed this call which
seems to have speeded things up.
Comment 2 Padraig Obriain 2008-05-13 14:04:46 UTC
Created attachment 61332 [details]
proposed patch
Comment 3 Padraig Obriain 2008-05-13 14:06:58 UTC
*** Issue 132835 has been marked as a duplicate of this issue. ***
Comment 4 Padraig Obriain 2008-05-13 15:27:06 UTC
changeset:   79979:8d84c2420554
tag:         tip
user:        padraigob@netbeans.org
date:        Tue May 13 14:02:46 2008 +0100
summary:     134902: Remove redundant code from HgUtils.isIgnored; Do not call HgUtils.isIgnored in
FileStatusCache.getCachedStatus