Your primary concern should be normalizing the data.  Issues like this don't
come up with normalized data and comma separated lists are an obvious sign
of a non-normalized database.

Barring that, the speed question comes down to if you're accessing items by
index or looping over them.  If looping, it's faster to leave as a list and
loop over the list.  If accessing by index, then it's faster to convert to
an array.  The reason is that every call to a list function tokenizes the
list so every time you call listGetAt CF parses the list.  So if you need to
make multiple calls, then you can use listToArray to force one-time
tokenization.  Looping counts as a single list call since it tokenizes the
list at the start of the loop and then loops over the tokens collection.  

List loops are faster than array loops since cf is looping over a native
java collection as opposed to an indexed cf variable instance.  More info
here: http://www.rewindlife.com/archives/000056.cfm

Best regards,

Sam

----------------------------------------
Blog http://www.rewindlife.com
TeamMM http://www.macromedia.com/go/team
----------------------------------------

>I have an application where I have to read a large file, record by record.
>After each record is read, I do some processing of the data and then save
it
>to a database table.  The question is, after I've read the record (which is
>a comma separated string) is it more efficient to use ListGetAt to access
>individual data elements or just do one ListToArray and then operate on the
>array?  Or, is there a better way?
>
>Walt
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to