On Monday, Jul 14, 2003, at 01:49 US/Pacific, Rich Hims wrote: >> On Wednesday, May 21, 2003, at 15:30 US/Pacific, Sean A Corfield >> wrote: >> See my other post (on Structs in CFMX - Java) where I timed both: > Sorry, but could you link us to this? Is CFMX-Java a houseoffusion > list, 'cos I couldn't see it in the navigation list.
It was on this list, a while back. "Structs in CFMX - Java" was the subject line, as far as I can recall. > Could this be because I'm running ColdFusion 5, not MX? Yes. > Why would the two versions produce such drastically different results? As someone else pointed out, CFMX is a complete rewrite in Java - CF5 (and earlier versions) were written in C++. CFMX compiles CFML to bytecode (technically CFMX compiles CFML to Java source code and then uses a Java compiler to compile the generated Java source code to .class bytecode; Red Sky improves on this process - 'how' is currently under NDA), and the bytecode is executed by the JVM (and, likely, compiled to machine code by the JIT - Just-In-Time - compiler). Earlier versions of CF turned the CFML into an intermediate code which was then interpreted by CF. Parsing - reading source code and 'understanding' it - is generally a slow process which is which most interpreters convert source code to some intermediate form. Since the two processes are (radically) different, the relative speed of many constructs will differ between CFMX and earlier versions - some may be slower, others faster. My Coding Guidelines document has a few performance-related hints & tips - with the caveat that "These techniques were true for CF4.5.1 SP2. Some have been tested under CFMX (these are noted) but most have not. [TBD: yet!] For the most part they are only important for very performance-sensitive code such as frequently called tags." When I release the next version of the guidelines (this summer), this section will have been completely overhauled. Another caveat: don't optimize unless you know you have a performance problem; don't optimize unless you have measured performance and located a bottleneck; don't optimize code unless you've already optimized your architecture and algorithms! (Spot a pattern here?) Write clean, simple code - the compiler is often better at speeding it up than you are! Sean A Corfield -- http://www.corfield.org/blog/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

