Re: Looping - Enumerators

Date : Fri, 13 Apr 2007 08:42:01 +0200
To : XSI(at)Softimage.COM
From : André Adam <a_adam(at)49games.de>
Subject : Re: Looping - Enumerators
To add to this particular observation, *any* looped access to XSI scene resources like parameter values should be avoided at any time, instead moving the parameter values into variables beforehand. The speed gain is tremendous.

   -André


withanar(at)stanwinston.com wrote:

-snip-
The Collection.count technique is taking advantage of the fact that your
Collection is already an assembled data structure. However, you are including
the Collection.count property in each iteration of the loop. We don't know how
efficient the Collection Object is at calculating its count property, and you
are asking it to do this each time the loop runs. Storing the count property
into a variable, then using that in the loop removes this burden like so:

n = Collection.count
for(var i=0; while i<n; i++){
   ...
}
-snip-

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.