Community
Participate
Working Groups
I20040204 I was tracing performance when opening an editor and found that > 7% is spent when the decoration scheduler calls toString() on the elements (mostly Java Elements) for the subTask label. I filed bug 51244 for this. JavaElement.toString >...> PackageFragment.getPath calls Path.append and which ends up calling Path.computeSegments which calls String.substring and which finally burns the cycles. I filed bug 51246 to improve Path.computeSegments. Maybe you can improve the getPath methods e.g. by not computing same information (like package path) several times.
Fixed CompilationUnit.isWorkingCopy() to not use the path to get the info, but the handle itself.
Could you also do something about PackgeFragment.getPath ? I saw this as hot spot in other scenarios (not via isWorkingCopy)
Sorry, the only solution would be to cache it on the handle object itself, which would cost to much memory. Please enter another bug report for the other case, and I'll see if I can 'not call' getPath().
Fair enough. If you send me a preview I can verify that it improved and trace the other cases.
Posted preview (v_404a) on JDT Core home page
The fix does its job. The other paths can be neglected, they only appeared because the item itself was on the top list.
Verified for 3.0-M7 with build 200402120010.