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 28957 - Speed up init of Find dialog
Summary: Speed up init of Find dialog
Status: VERIFIED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Search (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Marian Petras
URL: http://performance.netbeans.org/respo...
Keywords: PERFORMANCE
Depends on:
Blocks: 27795
  Show dependency tree
 
Reported: 2002-11-22 15:16 UTC by Marian Mirilovic
Modified: 2004-11-23 16:29 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
suggested patch (8.81 KB, patch)
2004-09-24 17:49 UTC, Marian Petras
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Mirilovic 2002-11-22 15:16:59 UTC
I suspect a new one is being created every time,
or at least its graphics context. Cache or make it
lightweight? 

Marian's measurement (time in milliseconds):
conditions: 
 - SUN UltraSparc60 / 512 MB RAM / Solaris 5.8 /
CDE
 - JDK1.4.1(01)
 - [nb_dev](200211140100) , MDI
        - mounted sampledir

find dialog on selected Filesystems node in
explorer
	1064    497     319

Test cases described on page :
http://performance.netbeans.org/qa/TestSuites.html#find_dialog_Filesystems_node
Comment 1 David Simonek 2002-12-06 18:03:56 UTC
Hm, isn't Find dialog part of search module or find module? I'm just
asking, I don't know exactly.
Comment 2 Marian Petras 2003-02-11 21:22:01 UTC
Yes, it is created each time the Find action is invoked.
Comment 3 Tomas Pavek 2003-06-10 14:33:14 UTC
I think this should be re-investigated for 4.0.
Comment 4 _ rkubacki 2004-09-24 08:39:09 UTC
Let's re-investigate:

even on my laptop with 2GHz processor+1GB RAM first open takes
regularly  sligtly more than 1sec. Next attempts are usualy within
500-600ms. We should profile what is happening during first call and
make it faster. Caching is probably not a way how to solve this.
Perhaps we should init tabbed panes in more lazy manner. Just guessing.
Comment 5 Marian Petras 2004-09-24 11:06:20 UTC
It seems I have much faster computer - it appears almost immediatelly,
even after computer restart.

Nevertheless, I found a probable bottleneck - its the initialization
of the panels, indeed. Particularly initialization of the Object Type
panel is slow. I will find some ways of how to improve it.
Comment 6 Marian Petras 2004-09-24 17:49:05 UTC
Created attachment 17863 [details]
suggested patch
Comment 7 Marian Petras 2004-09-24 17:56:56 UTC
The attached patch changes the Search dialog's behaviour such that the
panels for individual tabs are not fully initialized until they are
made visible. Specifically for the Object Type panel, this means that
loading of the list of object types is delayed until the panel is
selected. This should significantly reduce initialization time of the
dialog.

I will integrate the change on Monday, whether it fully solves the
problem or not, because I consider it to be an improvement... unless
somebody objects against the integration.

I would appreciate if somebody measured how much does this change help
(can be even before the integration).
Comment 8 Marian Petras 2004-09-27 07:56:45 UTC
I applied the patch to the CVS trunk.

Modified files:

    utilities/src/org/netbeans/modules/search/:
        SearchTypePanel.java   (1.19)
        SearchPanel.java   (1.24)
Comment 9 _ rkubacki 2004-09-29 10:36:15 UTC
Latest results from automated UI responsiveness tests show slightly
improved time on WinXP, Linux results are missing due to some problems
with test suite.
Comment 10 Marian Petras 2004-10-04 17:32:47 UTC
This helped a little bit but it was not the major problem.

I looked at what could cause such a slowdown and I think I know what
the problem - there are too many .class files generated from the
source code. So I will do the following changes and I hope it helps to
reduce the time significantly:

  - eliminate *BeanInfo classes for default search types
  - reduce nested/inner classes

Currently, there are 34 .class files generated from 16 source files. I
plan to eliminate 4 source files and additional 6-10 inner classes so
the number of .class files could drop to 20-24.

Comment 11 Marian Petras 2004-10-05 14:41:25 UTC
I integrated another improvement. It by-passes BeanInfo objects for
SearchTypes defined in the Utilities module and also reduces number of
nested/inner classes in SearchPanel and SearchTypePanel.

Modified files:

utilities/src/org/netbeans/modules/search/:
   SearchPanel.java   (1.25)
   SearchTypePanel.form   (1.3)
   SearchTypePanel.java   (1.20)
   types/FullTextType.java   (1.41)
   types/FullTextTypeBeanInfo.java   (deleted, last rev. 1.19)
   types/ModificationDateType.java   (1.28)
   types/ModificationDateTypeBeanInfo.java   (deleted, last rev. 1.18)
   types/ObjectNameType.java   (1.18)
   types/ObjectNameTypeBeanInfo.java   (deleted, last rev. 1.16)
   types/ObjectTypeType.java   (1.20)
   types/ObjectTypeTypeBeanInfo.java   (deleted, last rev. 1.13)
Comment 12 Marian Petras 2004-10-05 14:45:09 UTC
Another partial fix integrated - it reduces number of nested/inner
classes in ModificationDateCustomizer.

Modified files:

utilities/src/org/netbeans/modules/search/:
   types/ModificationDateCustomizer.form   (1.18)
   types/ModificationDateCustomizer.java   (1.30)
Comment 13 Marian Petras 2004-10-06 13:08:40 UTC
Another partial fix integrated - it reduces number of nested/inner
classes in TextCustomizer.

Modified files:

utilities/src/org/netbeans/modules/search/:
   types/TextCustomizer.form   (1.15)
   types/TextCustomizer.java   (1.25)
Comment 14 Marian Petras 2004-10-06 13:54:22 UTC
The changes made and integrated yesterday significantly improved
initialization time and the time is below limit on all tested
platforms. The change made today can only improve the time.

Marking as FIXED.
Comment 15 Marian Mirilovic 2004-11-23 16:29:06 UTC
verified