Partial parsing in NetBeans editor leads to significant performance boost

I got this info from Tomaz Zezula and Jan Becicka:

We made changes in the 6.1 java editor to reparse and reattribute only modified method rather than the whole java file. This leads to significant performance improvements. When the user types into the method only the top level method is reparsed which decreases both parse+attribute time and the time needed by tasks (hints, error marking, navigator) to recalculate changes. For example for modification of a method in the 150KB java class the benchmark looks like this:

75 ms
1 ms
Signature reattribution
318 ms
0 ms

Body reattribution

166 ms

4 ms

Also the newly added API allows the tasks listening on the Java model to recompute data only for changed method rather than for the whole file. Partial reparse has several limitations, it can't be used for methods contained in local classes or when modifying the source code of added or removed anonymous class.

What does this all mean for the user? It means much faster response in the java editor when making changes in the source code - full reparse is now mostly not needed and partial reparse is much faster (as seen on the table above). These changes are most visible on large classes where full reparse could have taken significant time in previous versions.


Impressive numbers for sure. Are these modifications already part of recent NB6.1 nightly builds? Surely would love giving that a try. ;)

Posted by kawazu on únor 14, 2008 at 02:11 dop. CET #

Yes, the changes are a part of the latest daily build.

Posted by Roman Strobl on únor 14, 2008 at 02:16 dop. CET #

Cool. On my way into this - would be kinda nice a gift for Valentine's day. ;)

Posted by kawazu on únor 14, 2008 at 02:28 dop. CET #

Great news, I'm just wondering if this kind of enhancement could be done for the jsp/jsf editor?

Posted by stojan on únor 14, 2008 at 02:48 dop. CET #

The JSP performance issues are separate, we are aware of them, e.g. look at:,71584,123441

Posted by Roman Strobl on únor 14, 2008 at 04:22 dop. CET #

It's really faster on my class which extends JTable.

Posted by zajo on únor 14, 2008 at 06:11 dop. CET #

Do you have any docs on partial parsing method used ?

Posted by Laurent M on únor 14, 2008 at 09:06 dop. CET #

Sorry, no docs are currently available.

Posted by Roman Strobl on únor 14, 2008 at 09:09 dop. CET #

Will this feature be backported in NB6.0?

Posted by Roman on únor 16, 2008 at 12:21 dop. CET #

We have no plans for backporting - 6.1 is coming in 3 months. We always look ahead - if we would spend time by backporting the progress of the IDE would be much slower.

Posted by Roman Strobl on únor 16, 2008 at 03:53 dop. CET #

Really nice performance enhancement, i am looking forward to testing it.

Are you currently working on other performance enhancements?

Startup time is quite slow on a mac, but that might also have something to do with the fact that we do not have JRE 6 yet. :-(

Posted by Jesper Terkelsen on únor 17, 2008 at 02:02 odp. CET #

Yes, performance is one of big topics for 6.1. Expect faster startup in final 6.1, too, the developers are implementing a cache for modules which should bring significant improvements compared to 6.0. Performance in other areas should also get better.

Posted by Roman Strobl on únor 17, 2008 at 02:27 odp. CET #

Hi! About the nb6 startup time... Come on guys! nb its an IDE! (+platform+community ;) not a text editor with syntax highlight.
I dont see why startup time should be an issue. How many times you startup your nb a day? two times? It should be running all day, it purpose is to deal with giant projects not be a ultra-light-small-footprint-application. If you want a text editor to goof around with small java files please use notepad++ or something.

Posted by Mauricio on únor 26, 2008 at 08:17 odp. CET #

@Mauricio: You're right. :) I start it up once (in the morning), maybe twice if there are some updates to be installed (which happens during lunch break). Startup time isn't really of interest to me. The only "performance" issue so far I would subscribe to is the fact that JSP editor is a little slow in some situations. Asides that, I am pleased, at the very least with current 6.1 builds, in terms of speed. :)

Posted by kawazu on únor 26, 2008 at 11:51 odp. CET #

I usually start NetBeans 3-4 times a day, because sometimes it takes >500mb of memory. So, maybe it will be better to spend some time improving this issue than startup time.

Posted by stojan on únor 27, 2008 at 09:42 dop. CET #

Incremental syntactic analysis finally discovered? :-) I thought full reparsing each time was considered insane for IDEs a long time ago. BTW, how does this fit with Java Compiler API, which is AFAIK used in NetBeans editor for parsing since version 6?

Posted by Ladislav Thon on březen 10, 2008 at 11:14 dop. CET #

Post a Comment:
Comments are closed for this entry.

Roman Strobl


« červenec 2016