Bug 299968 - API builder performance still bad for incremental build
Summary: API builder performance still bad for incremental build
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: API Tools (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 3.6 M6   Edit
Assignee: Darin Wright CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on: 285875 290324
Blocks:
  Show dependency tree
 
Reported: 2010-01-18 12:59 EST by Markus Keller CLA
Modified: 2010-03-01 09:55 EST (History)
5 users (show)

See Also:
markus.kell.r: review+


Attachments
patch (65.98 KB, patch)
2010-01-30 17:09 EST, Darin Wright CLA
no flags Details | Diff
updated patch (575.71 KB, patch)
2010-02-01 16:15 EST, Darin Wright CLA
no flags Details | Diff
updated patch (588.91 KB, patch)
2010-02-01 23:05 EST, Darin Wright CLA
no flags Details | Diff
update (595.21 KB, patch)
2010-02-02 16:37 EST, Darin Wright CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2010-01-18 12:59:19 EST
I20100115-1100

The API builder performance is still bad for incremental build scenarios. Prior to API Tools, working with the Eclipse compiler was really slick, since everything was compiled as soon as you lifted your finger from Ctrl+S.

But nowadays, API Tools is THE performance bottleneck that hits me literally every minute. E.g. right now, I'm in org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.CamelCaseComparator.compare(Object, Object), and when I change '-1' to '-2' here, it takes 25s until the "incremental" build is done. For comparison, the same operation takes 4s when I disable the baseline (including Save Actions and the API tools builders). And this is with all the cached warmed up and using an SSD, not a floppy disk.

Bug 233643 may have brought some improvements, but they are yet enough to bring me back to speed.
Comment 1 Darin Wright CLA 2010-01-30 17:09:13 EST
Created attachment 157694 [details]
patch

This patch improves incremental build performance as follows:

* When API descriptions for source (workspace) types are updated, the description keeps track of whether it changed or not relative to the build being performed.
* The build context now separates structural changes and description changes (as well as structural dependents and descriptoin dependents).

The big difference is that when no API description changes, we no longer need to check the API use of dependent types.

On the implementation side API description changes are detected using CRC codes assocaited with a relative build time (counter). When ever a description changes, it is updated to the current build time (count) of its project. The build can then safely discard description changes that occurred before the current build time, only considering those that changed during the current build.

Running the existing performance tests, I did not see much difference (improvements). I need to write new tests that show when/how this approach wins - i.e. when there are no API description changes (the current tests include description changes/API use checks, so I would not expect them to change much).
Comment 2 Dani Megert CLA 2010-02-01 06:17:05 EST
>Running the existing performance tests, I did not see much difference
>(improvements).
Could you attach a patched plug-in, so that we could test it?
Comment 3 Darin Wright CLA 2010-02-01 16:15:26 EST
Created attachment 157842 [details]
updated patch
Comment 4 Darin Wright CLA 2010-02-01 23:05:22 EST
Created attachment 157862 [details]
updated patch
Comment 5 Darin Wright CLA 2010-02-02 16:37:32 EST
Created attachment 157967 [details]
update

Updated patch. Adds information to our build state to know when the build path of a project has changed. When the build path changes, we need to re-analyze dependents, since API descriptions of required projects/target platform may have changed.
Comment 6 Darin Wright CLA 2010-02-02 16:56:20 EST
Released to HEAD. Will continue to test in nightly builds.
Comment 7 Markus Keller CLA 2010-02-03 08:03:50 EST
Wow, that's amazing!

I'm working with N20100202-2000 now, and speedup is incredible. And in the few cases I tested, it was also correct.
Comment 8 Darin Wright CLA 2010-02-03 09:19:27 EST
(In reply to comment #7)
> And in the few cases I tested, it was also correct.

I suppose we can make it even faster if correctness is not a priority.
Comment 9 Darin Wright CLA 2010-02-09 14:32:24 EST
Fixed. Please verify (peformance), Markus.
Comment 10 Markus Keller CLA 2010-02-12 06:51:58 EST
> Fixed. Please verify (peformance), Markus.

Feels good in I20100209-2300, thanks.