Community
Participate
Working Groups
See bug 258822 comment #4. In the particular case of exporting from the workspace with the new option to use the class files compiled in the workspace, .api_description adds significant time to the export. Since we are using .class files from the workspace instead of recompiling, the time spent generating the api_description could in theory be spent before export. We should investigate reusing the results of the API Analysis Builder during export.
I think we should only scan compilation units inside API packages.
Created attachment 125665 [details] proposed fix looking at the task code I discovered that we scan every single .class file in the project specified in the task and also re-resolve the java ASTParser options every time we scan a collected .class file. Testing the fix against jdt.core the class files scanned went from 1181 down to 313 (only API types) and the average time to build the api description for jdt.core lowered to ~500ms
sample buildfile to test with: <?xml version="1.0" encoding="UTF-8"?> <project name="api_use_reporting" default="run" basedir="."> <property name="pname" value="org.eclipse.jdt.core_3.5.0.v_927"/> <property name="project_location" value="C:\Eclipse\workspaces\workspace\org.eclipse.jdt.core"/> <property name="binary_locations" value="C:\Eclipse\workspaces\workspace\org.eclipse.jdt.core\bin;C:\Eclipse\workspaces\workspace\org.eclipse.jdt.core\antbin"/> <property name="target_location" value="C:\Eclipse\exported\org.eclipse.jdt.core"/> <target name="run"> <apitooling.apigeneration projectname="${pname}" project="${project_location}" binary="${binary_locations}" target="${target_location}" /> </target> </project>
Andrew and Olivier could you please test the patch? If this patch is sufficient I will copy the same fix over to the deprecated FileGenerator task as well.
I would be tempted to record the public packages instead of the internal ones. In general there is more internal packages than public packages. Beside this, the patch looks ok. I'll make some benchmarks next week.
Created attachment 125898 [details] updated patch You are correct Olivier, we could save an additional bit of memory collecting the API packages and not the internal ones. This patch updates to collecting the API packages and also provides the performance fix for the deprecated generator task.
Applied patch to HEAD. will wait to mark fixed until we have a few more sample benchmarks
-1 for now and it looks like we are ending up with empty .api_description files. I am investigating.
Created attachment 126494 [details] Complement This is required to properly recurse into subfolders.
Michael, please review.
I released another patch for this issue. The directives being null is not enough for API packages. We actually have to check if x-internals is set to true or if an x-friend is set. Directives can also contain "mandatory", ... Michael, please verify last change.
verified.
Looks good to me. From bug 258822, I was seeing approx 40 seconds for api descriptions for a total of about 50 seconds for an export. Now I see the api portion of the export being complete at around the 7-10 second mark and the entire export being finished around 20 seconds. (This is reusing workspace class files, and with code that is not yet released for pde.ui).
marking verified