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 242143

Summary: slow project opening in NetBeans 7.4
Product: platform Reporter: pm-neti
Component: FilesystemsAssignee: Jaroslav Havlin <jhavlin>
Status: REOPENED ---    
Severity: normal CC: Geron, oukjweather, pmk1c, scanti, tmysik
Priority: P3    
Version: 7.4   
Hardware: PC   
OS: Windows 8 x64   
Issue Type: DEFECT Exception Reporter:
Attachments: 7.4 profiler
7.3.1 profiler
A threaddump
A threaddump
A threaddump

Description pm-neti 2014-02-20 12:31:14 UTC
Created attachment 145432 [details]
7.4 profiler

When opening the same project in NB 7.3.1 and 7.4,
version 7.4 needs takes much more time to show project structure and make it usable:
7.3.1 http://screencast.com/t/fRBYUk1cBNZA
7.4 http://screencast.com/t/PWzF0nuNb
Comment 1 pm-neti 2014-02-20 12:31:57 UTC
Created attachment 145433 [details]
7.3.1 profiler
Comment 2 Tomas Hurka 2014-02-21 09:28:04 UTC
Snapshots show that most of the time is spent in owning PHP project. Reassigning to PHP for further evaluation.
Comment 3 Tomas Mysik 2014-02-28 09:46:02 UTC
For NB 7.4, we have added support for HTML5 and we need to register recursive FS listener on Source Files. However, I am not sure why it takes more than 15 seconds (slow FS? big project?). In any case, I don't see anything that can be fixed but reassigning to FS so the snapshot can be evaluated, thanks.

@reporter: How big is your project? How many files does it have? Do you have it on a local drive?

Thanks.
Comment 4 Jaroslav Havlin 2014-02-28 11:51:09 UTC
> However, I am not sure why it takes more than 15 seconds (slow FS? big project?)
Probably slow filesystem, which is quite common on Windows OS.

Closing as incomplete for now.

Thank you.
Comment 5 pm-neti 2014-02-28 11:58:18 UTC
> How big is your project?
~250MB

> How many files does it have?
~10k

> Do you have it on a local drive?
local-network drive

I don't mind if my project is opening even 30s, but my main question is:
why NB7.4 is much slower than 7.3.1 when opening the same project on the same PC?
Comment 6 Jaroslav Havlin 2014-02-28 12:14:48 UTC
> > How many files does it have?
> ~10k
> > Do you have it on a local drive?
> local-network drive
Adding native file listeners to a network drive is quite slow, this cannot be fixed in NetBeans.

It's not very recommended to have a project on a remote drive. If possible, consider using a version control system.


> Why NB7.4 is much slower than 7.3.1 when opening the same project on the
> same PC?
NetBeans 7.4 tracks dependencies between files in HTML projects. So when some file is changed, possibly externally, the IDE needs to be informed about the change, so that it can check state of the project (and show warnings or errors, update indexes for code completion, etc.). And that's why the native listeners are registered - to inform the IDE when a file is modified.

(Tomas, feel free to correct or complete my answer.)
Comment 7 meffen 2014-03-12 10:16:10 UTC
Same problem here with netbeans 7.4. Projects are on local drive (not network). Tested on Windows 7 and Mac OSX 10.9.2.
Projects have ~10.000 files, but only ~200 *.html files.
Comment 8 sebastiansommer 2014-03-12 10:28:47 UTC
Got the same problem! Is there a option to turn this off ?

(In reply to Jaroslav Havlin from comment #6)
> > > How many files does it have?
> > ~10k
> > > Do you have it on a local drive?
> > local-network drive
> Adding native file listeners to a network drive is quite slow, this cannot
> be fixed in NetBeans.
> 
> It's not very recommended to have a project on a remote drive. If possible,
> consider using a version control system.
> 
> 
> > Why NB7.4 is much slower than 7.3.1 when opening the same project on the
> > same PC?
> NetBeans 7.4 tracks dependencies between files in HTML projects. So when
> some file is changed, possibly externally, the IDE needs to be informed
> about the change, so that it can check state of the project (and show
> warnings or errors, update indexes for code completion, etc.). And that's
> why the native listeners are registered - to inform the IDE when a file is
> modified.
> 
> (Tomas, feel free to correct or complete my answer.)
Comment 9 Tomas Mysik 2014-04-04 12:04:12 UTC
*** Bug 243444 has been marked as a duplicate of this bug. ***
Comment 10 Tomas Mysik 2014-04-09 06:16:44 UTC
*** Bug 243632 has been marked as a duplicate of this bug. ***
Comment 11 Jost0 2014-04-29 11:59:28 UTC
Same here, and it also applies to netbeans 8.0.

Project is a TYPO3 project.

Number PHP files: 3.2k in core, extensions add about 500 more
Total number of files: 13k in core, others add 12k (mostly temp stuff).

The core is only symlinked in the project folder.
The projects are all on my local hard drive, on an ext4 partition within my (encrypted) home directory.

When I have multiple of these projects open, starting netbeans takes quite some time (10 Minutes, usually have to make a coffee). Even if I try to keep the number of open projects down to 2 or 3.
Comment 12 Jaroslav Havlin 2014-05-16 11:52:11 UTC
(In reply to sebastiansommer from comment #8)
> Got the same problem! Is there a option to turn this off?
You can try starting NetBeans with command-line parameter -J-Dorg.netbeans.modules.masterfs.watcher.disable=true

Also see http://wiki.netbeans.org/ScanOnDemand.

Please not that these options are quite experimental.
Comment 13 Tomas Mysik 2014-07-15 14:37:42 UTC
*** Bug 245378 has been marked as a duplicate of this bug. ***
Comment 14 Jaroslav Havlin 2015-02-04 12:07:35 UTC
I've noticed that algorithm in FileObjectKeeper.isCyclicSymlink is different from FileUtil.isRecursiveSymbolicLink.
I'll compare these two implementations and if needed, I'll modify the FileObjectKeeper to use the faster one.
Comment 15 Jaroslav Havlin 2015-11-06 10:16:58 UTC
(In reply to Jaroslav Havlin from comment #14)
> I've noticed that algorithm in FileObjectKeeper.isCyclicSymlink is different
> from FileUtil.isRecursiveSymbolicLink.
The semantics in FileObjectKeeper is a little different. It doesn't check if the file is symbolic link referring to an ancestor, but it checks if the file name matches some of its ancestor's name and in this case it checks if the real files are identical. So it checks whether the file is _under_ recursive symlink (which is sufficient in this case), and thus it can work without any I/O operations in many cases. The actual getting of real (referenced) files uses the same API (NIO2), so the performance is the same or better in FileObjectKeeper.

> Same here, and it also applies to netbeans 8.0.
Can you please attach new profiler snapshot taken from NetBeans 8.1?
(There are some performance improvements.)

Have you tried command line argument suggested in comment 12? Did it help?
Comment 16 scanti 2016-10-26 00:47:11 UTC
Created attachment 162637 [details]
A threaddump
Comment 17 scanti 2016-10-26 00:47:29 UTC
Created attachment 162638 [details]
A threaddump
Comment 18 scanti 2016-10-26 00:49:06 UTC
Created attachment 162639 [details]
A threaddump