X

Partial parsing in NetBeans editor leads to significant performance boost

Guest Author

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:

Action
 BeforeAfter
Reparse
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.

Join the discussion

Comments ( 16 )
  • kawazu Thursday, February 14, 2008

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

    Cheers,

    Kristian


  • Roman Strobl Thursday, February 14, 2008

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


  • kawazu Thursday, February 14, 2008

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


  • stojan Thursday, February 14, 2008

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


  • Roman Strobl Thursday, February 14, 2008

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

    http://www.netbeans.org/issues/buglist.cgi?issue_id=123370,71584,123441


  • zajo Thursday, February 14, 2008

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


  • Laurent M Thursday, February 14, 2008

    Do you have any docs on partial parsing method used ?


  • Roman Strobl Thursday, February 14, 2008

    Sorry, no docs are currently available.


  • Roman Friday, February 15, 2008

    Will this feature be backported in NB6.0?


  • Roman Strobl Saturday, February 16, 2008

    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.


  • Jesper Terkelsen Sunday, February 17, 2008

    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. :-(


  • Roman Strobl Sunday, February 17, 2008

    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.


  • Mauricio Tuesday, February 26, 2008

    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.


  • kawazu Tuesday, February 26, 2008

    @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. :)


  • stojan Wednesday, February 27, 2008

    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.


  • Ladislav Thon Monday, March 10, 2008

    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?


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.