Re: [SWTBot-users] Performance optimization for SWTBot
Brought to you by:
kpadegaonkar
|
From: Hans S. <han...@ya...> - 2008-11-10 09:19:05
|
Yes, that would be good. Performance is one advantage. The other advantage is logging output. It was confusing for me to see that SWTBot searched after it already found a matching widget. Thats how I knew that it continues searching. Now a bit of something else, which has nothing to do with this topic. A bit of design philosophy. I am not yet familiar with all the patterns used in SWTBot. The logic jumps across different methods and classes in different hierarchies. Thats good usage of design patterns but sometimes harder to understand than a method (or a few of them, mostly in the same class) where all the logic is implemented. In a former project some co-workers were in my mind too fascinated of design patterns and for example used a state pattern where a simple if-else-if-else-if-else would have been sufficient and more easy to understand, document (UML and Javadoc), debug etc. Well its not yet too difficult to understand what happens inside SWTBot. But I just mean this as a kind of personal opinion that sometimes design patterns can be overused (which is not yet the case here I think). --- On Fri, 11/7/08, Ketan Padegaonkar <ket...@gm...> wrote: From: Ketan Padegaonkar <ket...@gm...> Subject: Re: [SWTBot-users] Performance optimization for SWTBot To: swt...@li... Date: Friday, November 7, 2008, 1:43 PM Hans Schwaebli wrote: > I have a suggestion for improving performance. > > I have seen that finding widgets by label collects all widgets it can > find and then it returns the widget by index. Often the index is 0. So > SWTBot could stop searching as soon as it finds the first widget > matching the criteria. Or if its the second widget which needs to be > found by label, it could stop searching as soon as it finds the second. Yes, that is quite correct. In fact SWTBot does that for all matchers, it always finds all the widgets that matched a particular widget and the selection based on the index is done at the end. This was done earlier to keep the API clean and simple, I'm however convinced that this is a good place to optimize, and can infact be scaled up to any number of finds. So we could stop looking after say 2 matches, if the user requested the 2nd widget. -- Ketan ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ SWTBot-users mailing list SWT...@li... https://lists.sourceforge.net/lists/listinfo/swtbot-users http://swtbot.org/ - a functional testing tool for SWT/Eclipse |