Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Looping over a Query

New Here ,
Jun 02, 2008 Jun 02, 2008
Can u tell me if there is any performance difference in looping over Query result using cfloop and cfoutput ?
398
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 02, 2008 Jun 02, 2008
To find out for yourself do something like this:

1. run your query.
2. set a start time variable using gettickcount().
3. set up a loop from 1 to a million.
4. run through the query using cfoutput.
5. after the closing cfloop tag, set a stop time variable using gettickcount.

repeat steps 2 to 5, but using cfloop in step 4.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 02, 2008 Jun 02, 2008
LATEST
i tried this exapmple
but my query has only 100 records. and the execution time is shown as 16 using the get tickcount.
It shows no difference at present. But when the records increases what will be the case ?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources