Skip to main content
Participating Frequently
February 15, 2009
Question

Does cfscript output faster???

  • February 15, 2009
  • 3 replies
  • 1082 views
Hello to All!!!
I need to output a table with query data. If I do it with cfscript, I'll have to write:
<cfscript>
writeoutput ("<div id = test><table border =0>");
writeoutput ("Here are my HEADERS of table");
for (x = 1; x LTE qMy.RecordCount; x=x+1) {
writeoutput ("<tr><td>#qMy.a#</td><td>#qMy.b#</td><td>#qMy.c#</td>.......</tr>");
}
writeoutput ("</table></div>");
</cfscript>

So I have to do:
1 for_loop and
3 writeoutputs.

Does this method faster then use <cfloop = query> or simple <cfoutput> ?????
And what about "rules" for html tags, if I want to use "cfscript output" for outputting html code?
Thanks for your answers!!!!
This topic has been closed for replies.

3 replies

davidsimms
Inspiring
February 18, 2009
Inspiring
February 15, 2009
> Hello to All!!!
> I need to output a table with query data. If I do it with cfscript

I don't see the benefit of using CFScript in a scenario like this: you're
just making work for yourself.

For code of such trivial complexity, any performance differences in the
execution time of CFScript vs CFML will be inconsequential.

Your aim here should be to write good clear code; and CFML is going to be
clearer in this case. IMO.

--
Adam
Inspiring
February 15, 2009
With cfscript you add complexity and nothing else. cfoutput with a query attribute is the simplest and most efficient way to accomplish your goal.