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 225647 - org.netbeans.modules.parsing.impl.indexing.errors.ErrorAnnotator.isInError: LowPerformance took 24773 ms.
Summary: org.netbeans.modules.parsing.impl.indexing.errors.ErrorAnnotator.isInError: L...
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: Parsing & Indexing (show other bugs)
Version: 7.2
Hardware: All All
: P4 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2013-02-01 18:11 UTC by Exceptions Reporter
Modified: 2016-07-07 07:26 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 165993


Attachments
nps snapshot (1.11 MB, application/nps)
2013-02-01 18:12 UTC, Exceptions Reporter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2013-02-01 18:11:41 UTC
Build: NetBeans IDE 7.2.1 (Build 201210100934)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.6-b04, Java(TM) SE Runtime Environment, 1.7.0_11-b21
OS: Mac OS X

User Comments:
GUEST: Running make clean outside of NetBeans

GUEST: I was doing a Git clone from a remote repository. This repository has about 5,000 files in it.

St.Ev: svn up



Maximum slowness yet reported was 24773 ms, average is 8985
Comment 1 Exceptions Reporter 2013-02-01 18:12:09 UTC
Created attachment 130941 [details]
nps snapshot
Comment 2 Svata Dedic 2013-05-31 15:27:38 UTC
I am not sure whether it belongs to editor/parsing: significant amount of time is spent in URLMappers. Please check and/or advise if something can be done from the Parsing API side.
Comment 3 Svata Dedic 2013-06-03 09:00:21 UTC
Looking at the source in ErrorAnnotator once more ... the time-consuming call is 'just' FileObject.getURL(), which is supposed to be very fast. 

I am inclined to believe the sampler data is not correct in that case, since it recorded ~260 creations of java.net.URI taking > 11 secs, which seems as a nonsense (no I/O happens in URI constructor I think).

Would it be possible to iterate through the urls supplied to updateInError, map them to FOs, then lock the collect to only update entries for the existing FOs - lahvaci ?
Comment 4 Jan Lahoda 2013-06-03 10:06:51 UTC
(In reply to comment #3)
> Would it be possible to iterate through the urls supplied to updateInError, map
> them to FOs, then lock the collect to only update entries for the existing FOs
> - lahvaci ?

I would prefer to avoid that - there may be thousands of URLs passed to updateInError, and mapping all of them to FileObjects might take a lot of time (when this method was written, this would mean the FOs would need to be created as well, as the Java infrastructure did not use FileObjects for scanning. Now when parsing.api is using FOs, it would only be the conversion time.) I think it should be possible to split the lock, though, first copying the knownFiles2Error.keySet() into a local storage and then locking the lock just to update the INVALID status.
Comment 5 Svata Dedic 2013-06-03 10:26:31 UTC
OK, I don't know the code details so I didn't want to suggest change in the sync model between updateInError and WORKER runnable; so far updateInError processes all the knownFiles without intervention. With a local copy of knownFiles2Error, the WORKER might add an entry with a matching URL to the shared copy while updateInError would be still processsing the local copy without that entry.
Comment 6 Jaroslav Havlin 2013-08-20 17:07:11 UTC
It seems that the slow initialization of URI objects cannot be fixed in
filesystems. Can I reassign the issue back to editor/Parsing and Indexing,
or somewhere else?
Thank you.
Comment 7 Jaroslav Havlin 2013-09-20 09:33:40 UTC
(In reply to Svata Dedic from comment #3) 
> I am inclined to believe the sampler data is not correct in that case, since
> it recorded ~260 creations of java.net.URI taking > 11 secs, which seems as
> a nonsense (no I/O happens in URI constructor I think).
The URI initialization time is really very strange, no I/O should happen there.
I don't know how to fix this in filesystems.
FileObject.getURL should be probably called off the ErrorAnnotator lock.

There are only a few duplicates, and the bug is quite rare, decreasing priority.
Comment 8 Martin Balin 2016-07-07 07:26:43 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss