|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
FOR vs WHILE loop |
« View previous topic :: View next topic » |
Author |
Message
|
NMurthy |
Posted: Mon Aug 02, 2004 10:30 pm Post subject: FOR vs WHILE loop |
|
|
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 |
|
 |
JT |
Posted: Tue Aug 03, 2004 5:48 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
|
Back to top |
|
 |
martinrydman |
Posted: Tue Aug 03, 2004 5:50 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|