I'm rewriting my CFMakeTree tag in order to make it tighter and work in CFMX
better. One of the assumptions I had was that Lists would be problematic in
comparison to Arrays or Structs. My first test was to find a value in one of
these data collections.
For Lists I used ListFindNoCase. For Arrays, I looped over the array to find the
value and for Structs I used StructFindValue(). I ran each test in a 1000
iteration loop to see if anything showed up. On the whole, Arrays took the
longest, which is to be expected as they had to loop (no native arrayfind
function). Structures took less then 10% of the array time to search and lists
took 1/3 of the struct time. The data set was 0-9a-z written out in full and the
item searched for was the z.
So the results are basically that lists are easier to search than either
structures or arrays.
As a side note, I tried using a query of queries and it was much, much slower.

The second experiment was to loop over each data collection. In this, we see
much different results.
Arrays were fastest. Lists were anywhere from about as fast as an array to twice
as slow. Structures tended to be on par with lists, but sometimes slower.
On the whole, unless you see a need to, I'd stick with using lists in CFMX. I
have heard of people who have seen some major slowdowns due to lists and I'd
love to hear the specifics.

Michael Dinowitz
Master of the House of Fusion
http://www.houseoffusion.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Reply via email to