While running some code on CFMX, I saw what looked like a performance degradation. In order to check it out, I ran a few tests and below are the results. The test was to run a query, cache it and then use some code to search that query for a value later on. This might sound like a perfect job for query of queries, but I've always found that to be rather slow and we're just doing a fast, simple search. The 7 different search types used were: 1. Query of Queries 2. turn the DB into a ValueList() and then run ListFind() 3. Assume that the valuelist() from above is cached, run ListFind 4. Do a QueryLoop 5. Turn the query into a struct and do structkeyexists() 6. assume that the struct from above is cached, do structkeyexists() 7. assume that the struct from above is cached, do StructFindKey()
In CF5, the fastest across the board was number 6. Turning the query into a structure was rather costly time wise, but once it was cached, StructKeyExists() always had a speed of 0. 3 and 7 were almost always neck and neck while 3 was considered better as turning the query into a list was rather fast. 4 was always slow while 1 was right behind it. The results show that when looking for a value in a query in CF 5, QoQ may not be the answer while lists look like a very viable solution. This changes in CFMX CFMX 6.1 showed everything to be faster EXCEPT lists which became slower (valuelist lost a lot of power). In CFMX, structures still ruled speed wise as long as the query was turned into a structure first. If not, then it was still rather slow. QoQ beat out list searching when no caching was in place but again lost when the list was cached. Final results: Caching helps if you can use it. If not, then QoQ is the best route to go for a single search. More details and full stats in the next issue of FA. Also, I've got to change some code in HoF to take advantage of these results. Michael Dinowitz Finding technical solutions to the problems you didn't know you had yet ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 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

