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 208816 - Missing BinaryForSourceQueryImpl slows down CosSynchronizerIndexer
Summary: Missing BinaryForSourceQueryImpl slows down CosSynchronizerIndexer
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.1
Hardware: All All
: P2 normal (vote)
Assignee: Jesse Glick
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 206024
  Show dependency tree
 
Reported: 2012-02-24 08:29 UTC by Tomas Zezula
Modified: 2012-04-20 13:05 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Snapshot (268.57 KB, application/octet-stream)
2012-02-24 08:29 UTC, Tomas Zezula
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Zezula 2012-02-24 08:29:02 UTC
Created attachment 116077 [details]
Snapshot

Most of the CosSynchronizerIndexer time is spent in the
BinaryForSourceQuery.DefaultResult.getRoots() which needs to do quite expensive
calculation (queries lots of ClassPath.getClassPath, SFBQ.findSources).
The overall time spent in the CosSynchronizerIndexer is quite significant. For glassfish project the complete up to date check is 250s from which CosSynchronizerIndexer takes 143s. Similar problem was in NbModuleProject where adding of BinaryForSourceQueryImpl improved the performance by 90%.
Comment 1 Milos Kleint 2012-02-27 07:49:19 UTC
we already have a project based BFSQ that covers the project's artifact in the local repository.

This new additional BFSQ implementation would  map a binary artifact to all source jars in repository, unless covered by the project one already. Is that correct?
Comment 2 Tomas Zezula 2012-02-27 14:13:24 UTC
The measurements were done on NB 7.1. When the maven BFSQ was added?
If it was added in dev it may be already fixed. Should I remeasure it on dev?
Comment 3 Milos Kleint 2012-02-27 14:26:12 UTC
AFAIK it's there for multiple releases..
Comment 4 Tomas Zezula 2012-02-27 14:32:48 UTC
In this case it does not seem to be enough.
I will run the IDE with debug messages to find out for which roots the default BFSQ.Result is used.
Comment 5 Jesse Glick 2012-02-27 16:09:48 UTC
No need, logging shows that src/{main,test}/resources/ is not mapped.
Comment 6 Jesse Glick 2012-02-27 16:34:50 UTC
core-main #ee4e39fada10
Comment 7 Tomas Zezula 2012-02-28 09:58:32 UTC
Great!
The CosSynchronizerIndexer time has decreased from 165s to 2s for glassfish project.
Thanks
Comment 8 Quality Engineering 2012-02-28 10:51:48 UTC
Integrated into 'main-golden', will be available in build *201202280400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ee4e39fada10
User: Jesse Glick <jglick@netbeans.org>
Log: #208816: Missing BinaryForSourceQueryImpl slows down CosSynchronizerIndexer
Comment 9 Jesse Glick 2012-02-28 13:26:44 UTC
Hmm, if the improvement is really that dramatic it may merit a backport.
Comment 10 Marian Mirilovic 2012-03-21 17:20:42 UTC
Agree with integration into Patch 2
Comment 11 Jesse Glick 2012-03-21 23:40:07 UTC
releases #d4b88ea77726 (adjusted for branch), releases #52755cf5faea (test prerequisite), releases #bd1f7ddcbc06 (update)
Comment 12 Quality Engineering 2012-03-23 02:50:35 UTC
Integrated into 'releases', will be available in build *201203222205* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/d4b88ea77726
User: Jesse Glick <jglick@netbeans.org>
Log: #208816: Missing BinaryForSourceQueryImpl slows down CosSynchronizerIndexer
Comment 13 Tomas Danek 2012-04-18 12:29:35 UTC
could you please give me insight on some steps to be able to verify this in 7.1.2? Thanks in advance.
Comment 14 Jesse Glick 2012-04-18 12:40:25 UTC
I guess the simplest way is to run with -J-Dorg.netbeans.api.java.queries.BinaryForSourceQuery.level=FINE and check that findBinaryRoots(...) -> nil is no longer printed when opening Maven projects.
Comment 15 Tomas Zezula 2012-04-18 13:11:40 UTC
Open glassfish maven project in NB 7.1 and nb 7.1.2, create a nps and look on time spent in BinaryForSourceQuery.
Comment 16 Petr Cyhelsky 2012-04-20 13:05:33 UTC
Ok i tried to use the parameter and no findBinaryRoots(...) -> nil was shown when opening project with nonzero number of binary roots -> verified