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 97612 - Reduce number of loaded classes
Summary: Reduce number of loaded classes
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: _ gordonp
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2007-03-10 11:39 UTC by _ rkubacki
Modified: 2007-11-01 17:18 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ rkubacki 2007-03-10 11:39:35 UTC
On of early optmizations that we did during 3.3 release were related to
DataLoaders. Uprgade guide contained following text:

>>>
DataLoaders needs to be loaded into the IDE and initialized during the startup.
They are necessary for the IDE functionality and may be considered
entry point for file-type oriented modules. But there are things tightly
coupled with DataLoaders which are not necessary until the DataLoader
spot its file.<br>
The first thing is <code>DataObject</code> for given DataLoader.
Resolving DataObject too early can bring a lot of unneeded stuff into the IDE,
but it was a common use-case of the DataLoader because the DataLoader
have to pass its DataObject Class to the super constructor. As of OpenAPIs 1.10,
it is possible to pass DataObject Class's name instead of the DataObject
itself, so you should change your DataLoader constructor from
<<<

That's why
http://www.netbeans.org/download/dev/javadoc/org-openide-loaders/org/openide/loaders/DataLoader.html#DataLoader(java.lang.Class)
is deprecated and
http://www.netbeans.org/download/dev/javadoc/org-openide-loaders/org/openide/loaders/DataLoader.html#DataLoader(java.lang.String)
is prefered.

I see that the constructor with Class parameter is used in CND module(s).
Comment 1 _ rkubacki 2007-03-10 20:17:25 UTC
While optimizing loaders it can be usefull to evaluate the need for cached MIME
type. There is already similar cache for this purpose in
o.o.filesystems.MIMESupport that addresses the problem that MIME resolving can
be expensive operation. 
Comment 2 _ rkubacki 2007-03-10 20:18:00 UTC
My last comments is about ExeLoader.
Comment 3 _ gordonp 2007-03-12 17:42:24 UTC
Are you referring to the file object attribute we store (in
ExeLoader.findPrimaryFile())?
Comment 4 _ rkubacki 2007-03-12 17:56:32 UTC
Yes, I am. Also now I see that what you store is not exactly MIME type returned
by some MIME resolver. Is there some reason for this distiction? The MIME
resolver itself can be declarative too IMO.
Comment 5 _ gordonp 2007-03-12 18:20:24 UTC
> Is there some reason for this distiction?

Yes, but its probably obsolete. When netbeans first implemented the
declarative mime resolver it didn't cache anything. Since its very
expensive to resolve Elf exe files (you have to read the first 32 bytes),
we used the FO attribute as a means of limiting this read.

Now that NB caches mime type for each FO, it wouldn't seem to be necessary.
We also do it for Makefiles.
Comment 6 _ gordonp 2007-03-24 21:17:09 UTC
I fixed the 1st part of this and the 2nd is from code I wrote 6 years ago,
so I'll take that part, too.
Comment 7 _ rkubacki 2007-08-16 07:47:41 UTC
Checking in cnd/core/src/org/netbeans/modules/cnd/loaders/AsmDataLoader.java;
/shared/data/ccvs/repository/cnd/core/src/org/netbeans/modules/cnd/loaders/AsmDataLoader.java,v  <--  AsmDataLoader.java
new revision: 1.7; previous revision: 1.6
done
Checking in cnd/core/src/org/netbeans/modules/cnd/loaders/CCDataLoader.java;
/shared/data/ccvs/repository/cnd/core/src/org/netbeans/modules/cnd/loaders/CCDataLoader.java,v  <--  CCDataLoader.java
new revision: 1.7; previous revision: 1.6
done
Checking in cnd/core/src/org/netbeans/modules/cnd/loaders/CDataLoader.java;
/shared/data/ccvs/repository/cnd/core/src/org/netbeans/modules/cnd/loaders/CDataLoader.java,v  <--  CDataLoader.java
new revision: 1.7; previous revision: 1.6
done
Checking in cnd/core/src/org/netbeans/modules/cnd/loaders/CndAbstractDataLoader.java;
/shared/data/ccvs/repository/cnd/core/src/org/netbeans/modules/cnd/loaders/CndAbstractDataLoader.java,v  <-- 
CndAbstractDataLoader.java
new revision: 1.5; previous revision: 1.4
done
Checking in cnd/core/src/org/netbeans/modules/cnd/loaders/FortranDataLoader.java;
/shared/data/ccvs/repository/cnd/core/src/org/netbeans/modules/cnd/loaders/FortranDataLoader.java,v  <-- 
FortranDataLoader.java
new revision: 1.7; previous revision: 1.6
done
Checking in cnd/core/src/org/netbeans/modules/cnd/loaders/HDataLoader.java;
/shared/data/ccvs/repository/cnd/core/src/org/netbeans/modules/cnd/loaders/HDataLoader.java,v  <--  HDataLoader.java
new revision: 1.9; previous revision: 1.8
done
Checking in cnd/core/src/org/netbeans/modules/cnd/loaders/MakefileDataLoader.java;
/shared/data/ccvs/repository/cnd/core/src/org/netbeans/modules/cnd/loaders/MakefileDataLoader.java,v  <-- 
MakefileDataLoader.java
new revision: 1.8; previous revision: 1.7
done
Checking in cnd/core/src/org/netbeans/modules/cnd/loaders/ShellDataLoader.java;
/shared/data/ccvs/repository/cnd/core/src/org/netbeans/modules/cnd/loaders/ShellDataLoader.java,v  <--  ShellDataLoader.java
new revision: 1.8; previous revision: 1.7
done
Comment 8 Alexander Ioffe 2007-11-01 16:52:39 UTC
Verified in build 31102007
Comment 9 Alexander Ioffe 2007-11-01 16:57:39 UTC
Not verified. It was a mistake
Comment 10 Alexander Ioffe 2007-11-01 17:02:07 UTC
State was changed due to mistake. Setting back the status
Comment 11 Petr Nejedly 2007-11-01 17:18:53 UTC
OK, but I can really verify this as fixed...