Bug 2053 - Contributing views should not startup the plugin (1GDVL49)
Summary: Contributing views should not startup the plugin (1GDVL49)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P1 critical (vote)
Target Milestone: 2.1 M4   Edit
Assignee: Eduardo Pereira CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2001-10-10 22:25 EDT by Kevin Haaland CLA
Modified: 2002-12-18 14:41 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 Kevin Haaland CLA 2001-10-10 22:25:27 EDT
New support for contributing views should not automatically startup the contributor's plugin
if view is stacked. 

NOTES:
Comment 1 Unknown User CLA 2001-11-22 15:18:50 EST
Eduardo is working on a proposal for this, as the change will affect view 
lifecycle.  My own code, for lazy page creation, is implemented in 
WorkbenchPage.java, but not executed.  To see, go to the second constructor for 
WorkbenchPage(), where deferInit is called.  The restore is finished in 
onActivate, where finishInit is called.
Comment 2 Kevin Haaland CLA 2002-01-09 14:03:29 EST
Pls followup with David. Need to know definitively if there are real 
performance implications to this work as well as the impact on existing 
plugins. 
Comment 3 Eduardo Pereira CLA 2002-01-17 14:16:39 EST
Here is the two e-mail from me and David explaining why we should not change 
this.

I would recomend to close this PR without any change. The options to solve this 
brings more problems then it solves and the gain it not good enough.

Closing it. Please reopen if you think that work should be done or if you need 
more info.

++++++++++++++++++++

	Eduardo Pereira
	12/07/2001 03:54 PM
		
		 To: David Springgay/OTT/OTI
		 cc: Kevin Haaland/OTT/OTI@OTI
		 Subject: Re: Defering Part Creation

I have added printlns to time part creation, page creation, plugin startup as 
well as used optimize-it to try find the reason for implemention any of these 
options. I concluded that I would have the proposal to be voted and I would be 
the first to vote "-1".

I am convinced that "Defering Part Creation" should not be implemented. Giving 
the user a better startup time and make him pay the price latter is not a 
solution. 
 Option 1 would be easy for us to implement but would be a problem for ISV 
developers.
 Option 2 would introduce problems in the APIs like findView and getViews. The 
time spend writing/implementing propasals on how to do this breaking change 
could be better used in something else. IMO.
 Option 3 the current implementation is not creating the controls anyway. So 
the gained time is not that much. (I have timed it).

 The big reason not to do it is stated in DS's last 3 lines.

Thanks.
Eduardo.



	David Springgay
	12/07/2001 02:50 PM
		 
		 To: Kevin Haaland/OTT/OTI@OTI, Eduardo Pereira/OTT/OTI@OTI
		 cc: 
		 Subject: Defering Part Creation

Hi Kevin,

While you were away Eduardo investigated the idea of deferral of part 
creation.  Then he talked with me, and we formed the following opinions.  It 
would be incorrect to defer control creation.  It would be of little value to 
defer part or page creation.

Options:

1. Defer control creation in non visible parts.  If this approach is taken, 
each part must perform a null pointer check in every public method.  If any 
method is called, and the control is null, the part must implement some hack to 
answer the method correctly.  We only see this problem for 
IWorkbenchPart.dispose, because we are the workbench.  However, this is not a 
local problem.  The view can be accessed at any time, just by calling 
IWorkbenchPage.findView.  If the view has any other public methods, they must 
also be protected.  This is not part of the view contract, and it would be a 
breaking change to impose it now.  

2. Defer part creation in non visible parts.  If this approach is taken, the 
page must consider "part init state" in every public method.  It is not 
appropriate to misrepresent the parts within the page, just because we wish to 
defer their creation.   For instance, if findView is called for a part which 
hasn't been created, we must create the part and return its handle.  If 
getViews is called, we must also create all of the parts and return their 
handles; the result of this method should not be dependent on the init state of 
the page.  The getViews method in particular will be called as soon as the page 
is visible, because we use it to populate the Perspective > Show View menu.  We 
can implement this algorithm, but it will have no performance impact.  

3. Defer creation of everything within a non visible page.  If this approach is 
taken, we might be able to defer part creation, assuming that none of the part 
centric methods of the page area called.  However, if the loss of context 
proposal is approved, we will discourage the use of multipage mode, and this 
change will have no impact.

Regardless of whether 1, 2, or 3 is taken, the results of the optimization will 
be very dependent upon layout.  We cannot predictably determine the improvement 
in start up time.  

We also have one big issue with the idea of lazy creation.  By introducing lazy 
creation, we will also introduce staggered delays.  For instance, it may take 5 
seconds to switch to an invisible view in a tab folder.  It may take 10 seconds 
to activate a page.  From a user perspective, we are not convinced that this is 
an acceptable behavior.  It would be better to accept the startup cost at 
startup time.

Dave
Comment 4 Eduardo Pereira CLA 2002-11-21 10:11:45 EST
Reopening to mark as fixed. Views, editors and perspectives are lazy 
initialized now.
Comment 5 Eduardo Pereira CLA 2002-11-21 10:12:11 EST
Fixed in 2.1