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 35806 - Look.getLookupItems called for no good reason
Summary: Look.getLookupItems called for no good reason
Status: CLOSED FIXED
Alias: None
Product: contrib
Classification: Unclassified
Component: Looks (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Petr Hrebejk
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2003-08-27 16:31 UTC by Jesse Glick
Modified: 2008-11-18 11:31 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Stack trace fragment displaying problem (741 bytes, text/plain)
2003-08-27 16:32 UTC, Jesse Glick
Details
stack trace (1.67 KB, patch)
2003-08-28 14:38 UTC, Pavel Buzek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2003-08-27 16:31:41 UTC
While running a profiler over the threaddemo, I
was surprised to see that most of the CPU time was
spent in Lookup-related methods. This was odd
since I did not do anything which required Lookup
in any way: just opened a tree of LookNode's and
browsed it; no property sheet showing, no actions
to enable, etc. Seems that getLookupItems is
called as soon as the LookNode is displayed, even
when the results will never actually be used. This
is a terrible performance bug; getting lookup
items tends to be relatively expensive, compared
to methods like isLeaf, getIcon, getDisplayName
(depending on the application of course).

I think people on dev@projects have been
complaining about the same thing but I don't see
anything filed.

From what I understand, getLookupItems is used as
part of the Lookup which is passed back to other
methods in the Look. (Still don't really
understand why a Look would need to be passed
cookies which it presumably already has access to,
but that is a matter for documentation and use
cases I suppose.) But my understanding was that
the Lookup passed to other Look methods was
supposed to be lazy, and not call getLookupItems
at all unless and until someone made some query
against this Lookup. Clearly that is not the case.
This should be fixed and confirmed with a unit test.
Comment 1 Jesse Glick 2003-08-27 16:32:39 UTC
Created attachment 11457 [details]
Stack trace fragment displaying problem
Comment 2 Jaroslav Tulach 2003-08-28 09:21:26 UTC
Known problem. Hrebejk has a working fix on his harddisk. However he
is waiting for application of two_storages_32203 branch from issue 32203.
Comment 3 Pavel Buzek 2003-08-28 14:37:51 UTC
I have a similar problem: i register an InstanceContent.Convertor into
lookup of Project. The convert() method returns null for anything else
then one private class in j2eeserver module. It gets called with this
class as a parameter when the project node is created. I will attach
stack trace.
Comment 4 Pavel Buzek 2003-08-28 14:38:22 UTC
Created attachment 11467 [details]
stack trace
Comment 5 Petr Hrebejk 2003-08-29 09:41:32 UTC
For Pavel's issue and (stack trace) evaluation please see issue #35834
Comment 6 Petr Hrebejk 2003-08-29 14:08:06 UTC
The lookup was initialized when any method on LookNode was called.
This should not be the case now.
Comment 7 Marian Mirilovic 2004-02-24 16:13:42 UTC
closed