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 239619 - org.netbeans.modules.parsing.impl.indexing.URLCache.findFileObject: LowPerformance took 46654 ms.
Summary: org.netbeans.modules.parsing.impl.indexing.URLCache.findFileObject: LowPerfor...
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Git (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2013-12-18 16:22 UTC by pkevin
Modified: 2013-12-19 13:42 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 204610


Attachments
nps snapshot (96.38 KB, application/nps)
2013-12-18 16:22 UTC, pkevin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pkevin 2013-12-18 16:22:23 UTC
Build: NetBeans IDE 7.4 (Build 201310111528)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.0-b56, Java(TM) SE Runtime Environment, 1.7.0_40-b43
OS: Windows 7

User Comments:
GUEST: Slowness on opening files...

pkevin: Doing a build of a web service to deploy to Glassfish server.  Building the war file is taking forever.



Maximum slowness yet reported was 46654 ms, average is 35306
Comment 1 pkevin 2013-12-18 16:22:25 UTC
Created attachment 143310 [details]
nps snapshot
Comment 2 Tomas Zezula 2013-12-19 09:06:08 UTC
The data systems are doing save in the EDT causing fileChanged to be invoked in EDT and single call of URLMapper.findFileObject took 35s.
Comment 3 Jaroslav Havlin 2013-12-19 10:44:47 UTC
The first problem is that o.n.m.git.ui.actions.GitAction.performAction() calls o.n.core.NbLifecycleManager.saveAll() in EDT.

The second problem is in o.m.parsing.impl.indexing.RepositoryUpdater$FCL.fileChanged(), which performs a lengthy operation in the thread that performs the saving. It can make committing of changes quite slow. Can you please, Tomas, consider rescheduling it using e.g. request processor?

Thank you.
Comment 4 Tomas Zezula 2013-12-19 10:50:13 UTC
I just want to point out that the lengthy operation is a single call of URLMapper.findFileObject() taking more than 1/2 minute. :-)

Doing it asynchronously may be possible but complicated as all the changes define ordering. Braking ordering will cause nondeterministic parsing.
Comment 5 Ondrej Vrabec 2013-12-19 12:14:59 UTC
I can (and i should probably) save files in git in a background thread, but the fact that the whole process of handling file's modification takes so much time means that for example after calling Git -> Commit... user will have to wait for these 30 seconds anyway before the commit dialog is shown which seems wrong too.
Comment 6 Jaroslav Havlin 2013-12-19 12:40:26 UTC
(In reply to Tomas Zezula from comment #4)
> I just want to point out that the lengthy operation is a single call of
> URLMapper.findFileObject() taking more than 1/2 minute. :-)
The method calls FileUtil.normalizeFile, which needs to touch touch the disk.
If you are sure that the file is normalized, we might try to skip the normalization.

On the other hand, if the disk is stuck while calling FileUtil.normalizeFile, it would be probably stuck while performing the actual commit anyway. So fixing this particular part will not make the committing significantly faster.
Comment 7 Ondrej Vrabec 2013-12-19 12:47:45 UTC
> So fixing this particular part will not make the committing significantly faster.
This is not happening while committing but immediately after user clicks on Git -> Commit... so even before he gets any UI indication (commit dialog opens) so it will just look nothing is happening.
Comment 8 Ondrej Vrabec 2013-12-19 13:40:37 UTC
Moving the whole save into background. If you decide to make any changes in FS or Indexing regarding this issue, reopen and reassign to yourself.

fix: http://hg.netbeans.org/core-main/rev/bf9453b433c6
Comment 9 Tomas Zezula 2013-12-19 13:42:26 UTC
Yes, the URL came from the FileObject just to prevent to keep reference on FileObject.
Anyway I am trying to reschedule the fileChange when it comes from EDT.