On Nov 21, 2007 10:10 AM, Brad Wood <[EMAIL PROTECTED]> wrote:
> A SeeFusion stack trace did indeed show constant attempts to convert the
> strings to doubles, and then the resultant exceptions that were thrown
> and caught internally.

Note that if you run the CF8 debugger with break on exceptions
enabled, you'll see it tries to convert strings to numbers in <cfif>
as well in a lot of situations. This is kind of inherent in dynamic
languages - and why some people use compare() or compareNoCase() for
strings (but I think that's horribly ugly an unreadable).

> I ran the same test code on our new CF8 server and was very happy to see
> the switch was only about twice as slow for string values (and the same
> for number values).  And for 1 million loops it was literally the
> difference between 200 and 400 milliseconds.

Which is why this sort of optimization concern is so pointless! :)

Readability and maintainability are very important. Saving a
millisecond here and there in a web-based application is pretty
worthless since network latency and other issues tend to completely
swamp any miniscule code savings you might make using <cfif> instead
of <cfswitch>. And as we've seen repeatedly, what's faster in one
release of one CFML engine is slower in another release or another
engine...

For example, Railo is faster at locating unscoped variables but slower
as locating scoped variables - which is the opposite to ColdFusion! Do
what is most readable / maintainable for you and stop worrying about
micro-performance stuff!
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:293654
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