Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318474 - Model Updates should be smother with while (!display.readAndDispatch());
Summary: Model Updates should be smother with while (!display.readAndDispatch());
Status: RESOLVED INVALID
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-30 10:09 EDT by Lars Vogel CLA
Modified: 2013-07-23 16:11 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 Lars Vogel CLA 2010-06-30 10:09:34 EDT
I'm not sure if this is a real bug or an error I'm doing. 

I want to update the model via code and the change should be applied immediately. I use display.readAndDispatch() for this.

I believe the following two version are the same but the first version runs much, much faster. Perhaps this is a performance bug?


---------Slow------------------
int initialHeight = window.getHeight();
int initialWidth = window.getWidth();

for (int i = initialHeight; i >= untilValue; i--) {
	while (display.readAndDispatch())
				;
	window.setHeight(i);
	wait10();

}
--------------------------------

-------Fast---------------------
int initialHeight = window.getHeight();
int initialWidth = window.getWidth();
		
for (int i = initialHeight; i >= untilValue; i--) {
	while (!display.readAndDispatch()){
		window.setHeight(i);
		wait10();
	}
			
}
--------------------------------

I would assume that both ways should result in the same performance. Please correct me if I'm wrong.
Comment 1 Lars Vogel CLA 2013-07-23 16:11:28 EDT
Closing this bug, as my own example code is buggy.