Yes, cfsavecontent appears to use a java buffer internally, and runs
just about as fast. Pick whichever method gives you code you like
better with your content, its source, and your coding style.

Dave

On Sat, Nov 6, 2010 at 9:22 PM, Larry Lyons <larrycly...@gmail.com> wrote:
>
>>+1,000,000 for Jame's theory about string concatenation. CF is very
>>inefficient at this. Doesn't amtter much for small stuff and a few
>>repeats, but for bulk, a Java buffer is the way to go.
>>
>>Dave
>>
>>
>
> String concatenation is quite slow in CF. This blog did some fairly simple 
> tests and found that cfsavecontent was the fastest was to do string 
> concatendation, see http://blog.fi.net.au/?p=279
>
> I've run run similar tests using a more robust testing procedure and found 
> similar results, (see 
> http://www.aliaspooryorik.com/blog/index.cfm/e/posts.details/post/string-concatenation-performance-test-128)
>  Basically cfsavecontent is on the average twice as fast as the java string 
> buffer.
>
> What I'd suggest is do not write the file line by line but build up the 
> string using cfsavecontent then write the string to disk. I think you'll find 
> that that is about as fast as the PHP method, or nearly so.
>
> regards,
> larry
>
> --
> Larry C. Lyons
> web: http://www.lyonsmorris.com/lyons
> LinkedIn: http://www.linkedin.com/in/larryclyons
> --
> People need to realize that the plural of anecdote is not data.
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338921
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to