On Wednesday, Nov 6, 2002, at 06:57 US/Pacific, Gyrus wrote:
> "Notice that Toshi builds this list by creating it as a string, not a 
> list,
> since Macromedia now recommends that you avoid listAppend() and
> listPrepend() if possible." (p. 231)
>
> Is this true? Why so? Did I miss a meeting?!

Well, I mention something like this in the Coding Guidelines I 
published which are used internally, at least by my team. I was a 
little surprised to see it in Ben's book as well.

It is a performance issue and the bottom line is "it depends". Yes, 
lists are really strings and in CFMX string operations may be slower 
than in CF5 (because Java isn't as performant as C++ when manipulating 
strings right now). Note: *may* be slower. For small lists, where you 
simply loop over them with <cfloop list=...>, you probably don't need 
to worry. If your application depends on lists heavily for its core 
architecture, then you may find your application will benefit from 
analysis of the list functions and possibly changing to using arrays. 
Don't just rush out and change all your lists to arrays tho'... the 
overhead of converting lists to arrays and back again may well outweigh 
any speed benefits you may gain from manipulating arrays rather than 
lists.

I'll be interested to hear what Ben has to add to this.

Sean A Corfield -- http://www.corfield.org/blog/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Reply via email to