What would be your threshold number of cfswitch's that you would use
before deciding to switch to Java (or something else)?  Obviously you
appear to have a limit in mind.  I'll run the test that number of times.

I'm not advocating anyone code something 1 million times but most
performance problems show themselves under load.  

My point has simply been this:  Calling information about code which has
been shown to have a very significant performance decrease under load in
real world situations as an insignificant find is irresponsible in my
opinion.  My test may have been a bit of a hyperbole but I think it
successfully demonstrated the point.  The effect was linear in my
findings, meaning it would be less of a problem with less load, but it
was still around 90 to 100 times slower regardless.

Nowhere have I claimed my "test" to be perfect, but I don't think you
can dismiss the fact that users of CF7 whom rely on many cfswitch tags
evaluating strings on a high trafficked will experience slower code than
if they used a cfif construct.  Of course, I wouldn't recommend
re-writing any code unless you actually experience a problem; but my
original post was really an information post noting how the CF8
internals differed from CF7, not an everybody-go-rewrite-your-cf7-apps
post.

I feel that any information about a language and what it is faster or
slower at is noteworthy information.  I also feel any part of a language
which is shown to be around 100 times slower than alternative code is
very significant.  

Sure, make readable and clean code within reason-- but are you and Sean
suggesting that being informed of a language's weak and strong points is
pointless?

All I want is for people to recognize useful information about the
language they code in.  And as we all know-- "knowing is half the
battle".

http://en.wikipedia.org/wiki/G.I._Joe

~Brad

-----Original Message-----
From: Dave Watts [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 21, 2007 3:12 PM
To: CF-Talk
Subject: RE: cfswitch in cf8

> Not so fast there cowboy.  :)  The 200 mili and 400 mili 
> numbers were 1 million loops of a 4-faceted cfif and cfswitch 
> structure respectively comparing string values on CF8.
> 
> That same test on CF7.0.2 yields 1 second for the cfif and 
> 115 seconds (nearly two minutes!) for cfswitch.  Good luck 
> trying to blame two minutes of page load time on network delays.  :)
> 
> Do many people use 1 million cfif's or cfswitch's on a page?  
> Probably not. 
> Truth is though; there is at least one documented case where 
> a large number of cfswitch's on CF7 was literally bringing 
> down someone's server until they converted them to cfif's.  
> 
> The problem may not affect everyone, but it's worth noting as 
> opposed to writing it off IMO.

I have to say, I fully agree with Sean here, and disagree with you.

If ANYONE uses one million of ANYTHING in a single program, that person
has
bigger problems than optimization choices. CF is simply not the
appropriate
platform for a million operations of anything in a single program.
That's
not what it's for. If you have those kind of requirements, use something
else - Java comes to mind - and invoke it from CF.

A completely unrealistic test tells you how to optimize for completely
unrealistic environments. What's more, the optimization won't apply
universally to similar unrealistic environments in the future, because
the
internals of CF (and other CFML interpreters/compilers) change
frequently
enough to make your optimization choice fail in other versions.

"premature optimization is the root of all evil":
http://en.wikipedia.org/wiki/Optimization_(computer_science)#Quotes

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:293664
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to