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 238694 - Poor performance in editor (parsing and error highlighting)
Summary: Poor performance in editor (parsing and error highlighting)
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: EJB (show other bugs)
Version: 8.0
Hardware: PC Windows 8 x64
: P3 normal (vote)
Assignee: Martin Fousek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-22 11:51 UTC by akobberup
Modified: 2014-01-08 10:39 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
sample taken while waiting for the hint to show up (584.38 KB, application/octet-stream)
2013-11-22 11:51 UTC, akobberup
Details
IDE log (70.88 KB, text/plain)
2013-12-10 21:22 UTC, akobberup
Details
.npss file attached from NetBeans (86.36 KB, application/x-npss)
2013-12-12 09:21 UTC, akobberup
Details
ide log (89.25 KB, text/plain)
2013-12-12 09:23 UTC, akobberup
Details
.npss file attached from NetBeans (177.10 KB, application/x-npss)
2013-12-12 09:30 UTC, akobberup
Details
ide log (81.67 KB, text/plain)
2013-12-12 09:33 UTC, akobberup
Details
.npss file attached from NetBeans (55.53 KB, application/x-npss)
2014-01-07 15:07 UTC, akobberup
Details

Note You need to log in before you can comment on or make changes to this bug.
Description akobberup 2013-11-22 11:51:04 UTC
Created attachment 142478 [details]
sample taken while waiting for the hint to show up

I am unsure of where to place this issue - i guess that this is the most probable place to put it, but in case I am wrong, please move the issue.

In recent dev builds (roughly the ones in the last month or so i have seen a dramatic decrease in performance in the java editor. It seems to me that the root of the performance dip must be the parsing of the java files - and as a result everything from error highlighting to showing hints and invoking codecompletion is slowed down.

A quick example: 
I entered the following method in a class:

	@Override
	public void adminOptionsEnabled() {
		m_bAdminOptionsEnabled = true;
	}

No field in the class is called m_bAdminOptionsEnabled, so i waited for the hint "Create field" would show up.

However from the time I entered the text to the text had been formatted (m_bAdminOptionsEnabled in italic, and then with a red curly underline) and the hint showed up, 25 seconds went by.

This is just one example - everything just is slow unfortunatly!

Granted - i have some quite large projects opened ~ 7500 java files in all, but still - 25 seconds!!

I am running an intel i5 430m with 8gb mem and a solid state disk..
netbeans is allowed 2 gb heap space.

nb info:
Product Version: NetBeans IDE Dev (Build 201311210002)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Windows 8 version 6.2 running on amd64; Cp1252; da_DK (nb)
User directory: C:\Users\Anders\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\Anders\AppData\Local\NetBeans\Cache\dev
Comment 1 Tomas Zezula 2013-12-09 16:49:10 UTC
According to snapshot most of time is spent in HintsInvoker.computeHints.
Comment 2 Tomas Zezula 2013-12-09 16:50:14 UTC
>have some quite large projects opened ~ 7500 java files in all
The number of classes should not affect performance as they should be indexed and not used. Can you attach IDE log?
Thanks
Comment 3 Svata Dedic 2013-12-10 16:35:39 UTC
There are many hints calling J2EE HintsUtils.createEJBProblemContext taking > 100ms
Comment 4 akobberup 2013-12-10 21:22:39 UTC
Created attachment 143033 [details]
IDE log

I have updated since the initial report to a new build, and performance has increased noticeably.

The delay from performing this action now only is about 5 seconds
Comment 5 Martin Fousek 2013-12-11 15:25:55 UTC
Reporter please could you ask you for two additional data:
- newer npss snapshot since the delay cut to 5s so it will look differently
- run the IDE with property "-J-Dorg.netbeans.modules.j2ee.ejbverification.level=FINEST" and resend the messages.log then

It will help us a) to react on the latest situation from your IDE, b) to show how many EJBProblemContext instances are created since almost all of them should be get from cache.

Thanks a lot.
Comment 6 akobberup 2013-12-12 09:21:23 UTC
Created attachment 143089 [details]
.npss file attached from NetBeans

.npss file
Comment 7 akobberup 2013-12-12 09:23:10 UTC
Created attachment 143090 [details]
ide log
Comment 8 akobberup 2013-12-12 09:30:50 UTC
Created attachment 143091 [details]
.npss file attached from NetBeans

.npss file
Comment 9 akobberup 2013-12-12 09:33:59 UTC
Created attachment 143092 [details]
ide log

It seems to have some relevance how many other files are opened in the editor.
In the case where i took the second snapshot + log took, it took almost 10 seconds before the hint showed up, and i had opened a large number (20+) of files in the editor, a few of which are quite large (1000+ lines).

The same operation took under 5 seconds when only one file were opened.
Comment 10 Martin Fousek 2013-12-12 14:41:49 UTC
Thanks for additional data. I found out that at least on side of the ejb verification there is possible to precompute information about the session.

web-main #de10dca76daa

Reporter there are two new perf. improvement in the ejb hints, could you give it another try in few days (there is need to propagate changesets into the dev build)? Btw. attach npss then as usually. Thanks a lot!
Comment 11 Martin Fousek 2014-01-07 13:34:26 UTC
There should be available at least two improvements in the daily builds:
http://bits.netbeans.org/download/trunk/nightly/latest/

Reporter, please could you give it another try and prospectively upload the newest nps snapshot if it wouldn't be still ok? Thanks a lot.
Comment 12 akobberup 2014-01-07 15:07:11 UTC
Created attachment 143678 [details]
.npss file attached from NetBeans

.npss file
Comment 13 akobberup 2014-01-07 15:08:54 UTC
It is now quite fast - 2 secs or so.
Thanks a lot for the help. please name it if you need more info from me.
Comment 14 Martin Fousek 2014-01-08 10:39:42 UTC
(In reply to akobberup from comment #13)
> It is now quite fast - 2 secs or so.
> Thanks a lot for the help. please name it if you need more info from me.

That's great! From the last .npss it looks that the parsing task takes about 1.2 second and in the createEJBProblemContext method it spends 100ms, looks pretty reasonable.

Akobberup, thanks a lot for your help. I'm closing the issue now as fixed based on the web-main #de10dca76daa.