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 236780

Summary: Fetching property values for CodeStyle is slow in Maven project
Product: java Reporter: _ gtzabari <gtzabari>
Component: SourceAssignee: Svata Dedic <sdedic>
Status: RESOLVED FIXED    
Severity: normal Keywords: PERFORMANCE
Priority: P3    
Version: 7.4   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 204378
Attachments: nps snapshot

Description _ gtzabari 2013-10-04 18:19:17 UTC
This bug was originally marked as duplicate of bug 223778, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build 201309270002)
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:
gtzabari: Invoked code-format.



Maximum slowness yet reported was 10210 ms, average is 10210
Comment 1 _ gtzabari 2013-10-04 18:19:21 UTC
Created attachment 140816 [details]
nps snapshot
Comment 2 Milutin Kristofic 2013-10-07 14:00:37 UTC
Java formatting after save is blocking awt-thread by writelock in document. Sending to java source for evaluation.
Comment 3 Svata Dedic 2013-10-10 10:53:13 UTC
the bottleneck seems to be the CodeStyle, reading preferencies. In the snapshot, preferencies are read from the project-based configuration; just the MavenProjectPropsImpl.MergedAuxProperties take ~1.4 sec out of 9 seconds the UI thread was blocked by formatter. Total time spent in property reading is comparable to the total time the Formatter is running.

It seems the preference value is not cached anywhere between CodeStyle and MavenProjectPropsImpl.get().
Comment 4 Svata Dedic 2013-10-10 12:46:16 UTC
I've made a local fix that caches values inside CodeStylePreferences, which will probably help formatter, but performance of the project-level properties implementation should be still improved.

Rev. http://bertram.netbeans.org:8080/49606fbcab1a
Comment 5 Quality Engineering 2013-10-12 04:00:47 UTC
Integrated into 'main-silver', will be available in build *201310120001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/49606fbcab1a
User: Svata Dedic <sdedic@netbeans.org>
Log: #236780: code style preferences are read-only cached