ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » FOR vs WHILE loop

Post new topic  Reply to topic
 FOR vs WHILE loop « View previous topic :: View next topic » 
Author Message
NMurthy
PostPosted: Mon Aug 02, 2004 10:30 pm    Post subject: FOR vs WHILE loop Reply with quote

Newbie

Joined: 01 Jun 2004
Posts: 2

I want to know if there are any advantages/disadvantages of using a FOR against a WHILE loop in ESQL.

TIA,
Murthy
Back to top
View user's profile Send private message
JT
PostPosted: Tue Aug 03, 2004 5:48 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Check out chapter 2.3 ITERATIVE OPERATIONS: ftp://ftp.software.ibm.com/software/integration/support/supportpacs/individual/ip04.pdf

Dan Jones, IBM UK Laboratories wrote:
If there is no need to manipulate data only evaluate expressions based on the contents of an array, there is a clear benefit to using the FOR ALL function.
Back to top
View user's profile Send private message
martinrydman
PostPosted: Tue Aug 03, 2004 5:50 am    Post subject: Reply with quote

Centurion

Joined: 30 Jan 2004
Posts: 139
Location: Gothenburg, Sweden

Hi,

I used to be under the impression that they where identical (when using WHILE with ref varibles/LASTMOVE) under the hood, but after using the FOR a number of times, it doesnn't seem that way. Whereas a declared ref variable obviously is a ref variable, the 'variable' used in the FOR construct seems to be something else (exactly what it is is obscure...). Maybe someone familiar with the intricacies of ESQL could pitch in here?

If you're comparing FOR with WHILE using index/CARDINALITY, FOR should be a bit faster, especially when there's a large number of iterations. We've done some benchmarking on this, and it's not a huge save on performance. In our example it was some 20%.

HTH!

/Martin
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » FOR vs WHILE loop
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.