> That is an interesting idea. But would it truly be "faster" to add 3 > cfquerries to the function - when all I have now is one? > > I certainly see the power/flexibility of having the delivery date logic in a > table - because it would be easier to adjust it in the future - - But again > - is it faster?
I've been restraining myself a bit from replying to this thread, but apparently I've lost control of myself. First, in my opinion, you're overly concerned with "which is faster". In the vast majority of cases, this question isn't all that important. If it were, you'd be building web apps in C++, not CF. There are some specific things you should generally avoid doing in CF because they're usually slower than the alternatives, such as the query of query functionality, but beyond that you shouldn't be worried about which is faster, especially if the alternative approach is easier to maintain and more flexible. Second, three queries can, and often are, faster than one. It all depends on what the queries are doing. I haven't paid too much attention to the details of the thread, but it really does all depend on what the individual queries are doing. > >From what I have read - and what I understand - the query is where the > bottle neck usually happens - since you are hitting the database server. > ??? This is true. But it's not simply a matter of how many queries there are, it's about what those queries are doing and how long it takes for those queries to run. > Also - it seems like overkill to keep a database with 100 years of dates - > especially when we can easily find out any date with 1 tag of cf code. Is a > query and an output faster than a loop? > > I am asking because I don't know - and this is what I am trying to learn... > I like the ideas - but I am wondering if it truly improves performance or > not. Again, I think your focus on performance to the exclusion of all else is misplaced. "We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil" http://en.wikipedia.org/wiki/Program_optimization#When_to_optimize > Is there a way to know? I would love to test both methods and see what > the results are. Yes, of course you can test both methods. CF can keep time pretty well (+/- 10ms if I recall correctly) and CF has some useful timekeeping tags and functions (CFTIMER, getTickCount) which can easily be used to measure an individual iteration of a specific block of code. Of course, in a multithreaded environment, you really need to run parallel requests to see if there are resource contention issues, etc, and there are all sorts of load test tools and simple HTTP clients for that. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329737 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4