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 217412 - FileUtil.normalizeFile called very often for files that may not need to be normalized
Summary: FileUtil.normalizeFile called very often for files that may not need to be no...
Status: RESOLVED INCOMPLETE
Alias: None
Product: ide
Classification: Unclassified
Component: Performance (show other bugs)
Version: 7.3
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Tomas Hurka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-26 06:32 UTC by bht
Modified: 2012-10-31 15:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
log files in zip file (61.78 KB, application/zip)
2012-08-26 06:32 UTC, bht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2012-08-26 06:32:57 UTC
Created attachment 123571 [details]
log files in zip file

All my files are on a local disk as advised at 

http://wiki.netbeans.org/FaqScanningAndIndexingPerformanceHints#Use_fast_filesystem.2Fdisk

I have turned off drive indexing and virus scanning on project directories and NetBeans cache directories.

My disk is a fast IDE drive, WDC WD1600AAJB-00J3A0, a generation before faster SATA drives. File system is NTFS, physical memory 3GB, Processor speed is 1.9GHZ on a single AMD CPU.

So the system is slow by today's standards.

With 26 projects in the project explorer, I get 146 messages like

WARNING [org.openide.filesystems.FileUtil]: FileUtil.normalizeFile(C:\bt\java\enum\Enum) took 1,062 ms. Result is C:\bt\java\enum\Enum

I checked the files in the messages against the API documentation at:

http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileUtil.html#normalizeFile%28java.io.File%29

If we accept that my system is really that slow, then still the number of calls seem excessive wrt the purpose of the API.

I can see that in a number of cases, the method is called for project internal files such as:

- package directories nested inside source directories
- Java source files nested inside source directories e.g. session beans, entity beans
- class files nested inside build directories

Also for some files such as Gee1Wanted.java there are multiple successive log entries e.g. 8 times.

Perhaps performance can be improved by eliminating calls to FileUtil.normalizeFile in these cases where the file names don't need to be normalized
Comment 1 Tomas Hurka 2012-10-31 15:59:49 UTC
The main problem is that normalization of 'C:\bt\java\enum\Enum' should not take 1000 ms. We know that Windows file system is sometimes slow. So far we were not able to find the exact cause. If you know how to reproduce it, please let us know.