I develop using ColdFusion and wanted to know what is the best strategy to loop over large query result set. Is there any performance difference between using cfloop and cfoutput? If not, is there any reason to prefer one over the other?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I believe that there used to be. I think this difference has been tackled, the best bet is to do a test for each to test in you specific use case.
There are some notable differences though.
cfoutputcan do grouped loops, whichcfloopcannot.For
cfoutputyou can specify thestartrowand themaxrows(or the count) to paginate your result. Forcfloopyou have to specify theendrowindex instead of the count.Also you cannot use
cfoutputfor a query nested within an existingcfoutputtag, you will need to end the containingcfoutputfirst.