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 223290 - 17s - html code completion getIcon
Summary: 17s - html code completion getIcon
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Editor (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Marek Fukala
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2012-12-05 09:17 UTC by webdev
Modified: 2012-12-14 02:45 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 196119


Attachments
nps snapshot (39.34 KB, application/nps)
2012-12-05 09:17 UTC, webdev
Details
Proposed patch (18.96 KB, patch)
2012-12-11 16:03 UTC, Marek Fukala
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description webdev 2012-12-05 09:17:30 UTC
This bug was originally marked as duplicate of bug 198840, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 7.3 Beta 2 (Build 201211062253)
VM: Java HotSpot(TM) Client VM, 23.3-b01, Java(TM) SE Runtime Environment, 1.7.0_07-b11
OS: Windows 7
Maximum slowness yet reported was 17613 ms, average is 17613
Comment 1 webdev 2012-12-05 09:17:33 UTC
Created attachment 128876 [details]
nps snapshot
Comment 2 Marek Fukala 2012-12-05 12:42:21 UTC
The html code completion needs to get an icon for each FileObject in a folder for which the CC is opened.

To get the icon I just do:

DataObject.find(fo).getNodeDelegate().getIcon(java.beans.BeanInfo.ICON_COLOR_16x16);

Which IMO is the right way (please reassign back with some hint how to do that better/faster, if this wasn't the best way) I have no idea why it is so slow.
Comment 3 Jaroslav Tulach 2012-12-06 07:14:21 UTC
Getting an icon for each file in a folder is definitely something that may take a while. For example FolderChildren were modified in 7.2 to don't try to create DataObjects in EDT. Rather they create empty list of files and start computation of the icons on background. If you want your HTML completion to be fast, you need to do something similar.

DataFolder.findFolder(fo.getParent()).getNodeDelegate().getChildren().getNodes(false/true)

with false parameter you will get the result quickly, but the icons may be blank for a while. true parameter should guarantee correct result, but is going to be slow.
Comment 4 Marek Fukala 2012-12-11 16:03:02 UTC
Created attachment 129216 [details]
Proposed patch

I've created a fix which requires some changes at the editor.completion side. Dusane please review as we agreed already and I'll possibly push it.
Comment 5 Dusan Balek 2012-12-12 08:12:25 UTC
Proposed changes to editor.completion seem to be OK.
Comment 6 Marek Fukala 2012-12-12 10:19:14 UTC
Thank you Dusane for the review.

fixed in web-main#bb72712e8326
Comment 7 Quality Engineering 2012-12-14 02:45:39 UTC
Integrated into 'main-golden', will be available in build *201212140001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/bb72712e8326
User: Marek Fukala <mfukala@netbeans.org>
Log: #223290 - 17s - html code completion getIcon