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 65700 - Costly conversions in UpdateTrackingFOQuery
Summary: Costly conversions in UpdateTrackingFOQuery
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 5.x
Hardware: All All
: P4 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 65135
  Show dependency tree
 
Reported: 2005-10-03 11:40 UTC by _ rkubacki
Modified: 2005-11-16 15:58 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 2005-10-03 11:40:55 UTC
UpdateTrackingFileOwnerQuery(FileObject fo) always converts FO to java.io.File.
This is conversion is not trivial because it iterates URL mappers to find URL
with file: protocol gets its path and normalizes it.

The FOQ is now very important for many places of IDE like action enabling and
thus it is called even during typing in editor.

Shouldn't it be based on filesystems lib like other parts of IDE to aviod these
conversions?
Comment 1 Jesse Glick 2005-10-03 22:14:09 UTC
I don't know how to fix it in apisupport. It is unacceptable for ModuleList to
keep FileObject keys as it could leak memory. IMHO is would be much better to
fix FileUtil.toFile to use some sort of cache (which would also benefit all
callers, not just apisupport).
Comment 2 _ rkubacki 2005-10-10 15:32:03 UTC
I agree that caching might improve it a bit - issue #66361

OTOH we should be able to improve current state for users that develop just
regular J2SE/J2EE projects and do not have any NB module on their disk at least.
I mean as long as the ModuleList.knownEntries is empty the query can return null
and no conversion is needed. 
Comment 3 Jesse Glick 2005-11-06 23:18:40 UTC
Will implement the suggested optimization.
Comment 4 Jesse Glick 2005-11-07 00:22:23 UTC
committed   * Up-To-Date  1.3        
apisupport/project/src/org/netbeans/modules/apisupport/project/queries/UpdateTrackingFileOwnerQuery.java
committed   * Up-To-Date  1.20       
apisupport/project/src/org/netbeans/modules/apisupport/project/universe/ModuleList.java
Comment 5 pzajac 2005-11-16 15:58:42 UTC
Radim,
can you verify this bug?