Bug 227997 - ResourceInfo could avoid fields that mostly hold 'null'
Summary: ResourceInfo could avoid fields that mostly hold 'null'
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Resources-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2008-04-21 08:49 EDT by Martin Aeschlimann CLA
Modified: 2019-09-06 15:37 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2008-04-21 08:49:24 EDT
20080421

Analyzing my development instance of Eclipse (~50 source projects) with YourKit
7.0 shows that there are ~400'000 instances of 'ResourceInfo'.

In these instances
   97% of fields ResourceInfo.markers
   97% of fields ResourceInfo.syncInfo 
   87% of fields ResourceInfo.sessionProperties
   63% of fields ResourceInfo.fileStoreRoot
are null.
All the pointers to null take (together) 5.5 MB.

Alternative to fields would be
- use workspace global (weak) Maps that maps resourceInfo to markers, resourceInfo to syncInfo, ....
- implement something like ResourceInfo.setData(key, data) with a similar implementation as done in SWT.
- use a subtype of ResourceInfo (ResourceInfoWithSyncInfo)

Of course this it's always a tradoff between performance and memory.
Comment 1 John Arthorne CLA 2008-04-21 10:32:45 EDT
I've considered this in the past, but of course an SWT-style Map to store these values could take up even more slots depending on how many fields would be null. Note also that the number of null slots could vary greatly if you have different plug-ins installed that use more sync info and session properties, more markers, etc. We have to be careful not to optimize for a particular workspace and make it worse for other users.
Comment 2 Eclipse Webmaster CLA 2019-09-06 15:37:44 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.