If you're appending text line by line to a memory variable, you're
probably having issues relating to java strings being immutable. If
you're appending to a file each time, that's probably slowing you
down.

Try the loop without writing any strings out and see what the
difference is. If that's fast, try a Java class that buffers string or
file output depending on how you want it to work.
--
WSS4CF - WS-Security framework for CF
http://wss4cf.riaforge.org/



On 18 October 2010 11:14, Bryn Parrott <[email protected]> wrote:
>
> Dear All,
>
> I have this algorithm that runs a query or two against a mySQL (5) database 
> on a Win 2003 (64Bit) server.  The code loops over the query; assembles some 
> text and writes it out to a text file line by line.  Fairly simple really.  
> There are lots of records.
>
> When I code this algorithm and execute in PHP 5 it runs in 7 seconds (give or 
> take);
> When I code and excecute it in CF 8.0.0, it runs in around 74 seconds.
>
> The PHP code is being executed using cfexecute...
>
> Now to me this kind of performance degradation/difference between PHP and CF 
> is unintuive, given that PHP is interpreted; whilst CF is 'compiled'; I 
> expected CF to run faster.
>
> This was not my code to begin with however I have gone over it and checked 
> for all the usual suspects; memory leaks; var variables and the like.
> The CF code is in the form of a cfcomponent, and my execution time 
> observations were taken on the second run to take the compilation phase into 
> account.
>
> Now I'm aware that CF 8.0.1 fixed some performance issues relating to CFC 
> methods (I think...); but were the issues as severe as I am seeing ?
>
> Anyway, have others any views to offer on why I am seeing such a severe 
> performance degradation for CF over PHP and suggest any way in which I might 
> tune the CF code/server so that it is more nearly the same or better than the 
> PHP.  Sonme might suggest this is difficult since I have deliberately not 
> posted the code; however I'm thinking that perhaps you might suggest general 
> things I may not have thought of.
>
> Thanks,
> Bryn
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:338269
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to