Bug 27670 - ClasspathEntry.rootID allocates a lot of throw-away objects
Summary: ClasspathEntry.rootID allocates a lot of throw-away objects
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2002-12-04 11:33 EST by Adam Kiezun CLA
Modified: 2002-12-18 04:16 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2002-12-04 11:33:42 EST
every time ClasspathEntry.rootID() is called (which happens quite a lot)
a new StringBuffer is created, then a new string is appended to it and the 
buffer is toString'd.

the code is sth like:
 case IClasspathEntry.CPE_LIBRARY :
    return "[LIB]"+this.path;  //$NON-NLS-1$

maybe this could be avoided somehow - i'm not sure but if the entry kind are 
the path are not-modifiable (which seems to be the case), then rootID can be 
computed only once for each object.

however, that said, i did not check if it really is the case that rootID is 
indeed called many times on the same object.
if it is not true - feel free to close as 'bogus'. i mean, as 'invalid'.
Comment 1 Philipe Mulet CLA 2002-12-09 10:41:50 EST
Now caches the rootID on the classpath entry itself, and also changed senders 
to avoid using rootID aware code (some of them).

Fixed.
Comment 2 David Audel CLA 2002-12-18 04:16:32 EST
Verified.