I was reading a post on the cftalk list about interesting timing numbers via cf script and cfset. Read it here.
The post referenced a blog entry from Neil Middleton that published the timing numbers for doing some set statements via cf7, cf8, and bd.net. I noticed when reading the blog that the numbers posted were based on cf8 beta and not the release version. So, I decided to redo the tests posted and see how they differ from the post. Here is what I found...
Below is the code and the reported time from Neil's blog (CF8beta) and the result from my test (CF8.01). I did my test the same as his. Multiple runs, and reported the average times. The tests were ran on a WIN2003 Enterprise server (Quad 3.0 xeon / 2gb ram)
2<cfset foo = createObject("component","foo")>
3</cfloop>
| CF8 Beta | CF8.01 |
| 2100ms | 547ms |
2<cfparam name="myName" default="dave">
3</cfloop>
| CF8 Beta | CF8.01 |
| 16ms | 5ms |
2<cfset foo = "poo">
3</cfloop>
| CF8 Beta | CF8.01 |
| 31ms | 36ms |
2<cfset foo = arrayNew(1)>
3<cfset arrayAppend(foo, "This is an item")>
4</cfloop>
| CF8 Beta | CF8.01 |
| 1500ms | 39ms |
2<cfset foo = structNew()>
3<cfset foo.poo = "1">
4</cfloop>
| CF8 Beta | CF8.01 |
| 1266ms | 52ms |
2for (i=1;i lte 100000;i=i+1)
3{
4foo = structNew();
5foo.poo = "1";
6}
7</cfscript>
| CF8 Beta | CF8.01 |
| 78ms | 60ms |
So there you have it. It would appear that cf8.01 is even faster than the beta. However, the differences between 8 beta and 8.01 could be slanted due to machine performance differences.
--DAve
#1 by Aaron Longnion on 7/2/08 - 1:03 PM
Neil's tests were done on "Windows Vista and IIS7 on my laptop", but your tests were done on "WIN2003 Enterprise server (Quad 3.0 xeon / 2gb ram)". That's like comparing how fast I can run with some *beta* Nike shoes vs. a world-class sprinter wearing the same Nike shoes (but post-release). The shoes may be nearly the same, but the hardware (me=some sluggish Vista laptop vs. sprinter=Quad Xeon) is vastly different; so, I'm sorry to say that sounds like a completely invalid test comparison.
A "better" test would be to run CF 8 (beta) on the same machine where your CF 8.01 install resides.
btw - can you modify your blog software to allow plus (+) signs in email addresses: http://cfzen.instantspot.com/blog/2008/04/30/Does-...
#2 by radekg on 7/2/08 - 2:33 PM
public static void main(String[] args)
{
long start = System.currentTimeMillis();
for (int i=1; i <= 100000; i++)
{
Hashtable<String, String> foo = new Hashtable<String, String>();
foo.put("poo", "1");
}
System.out.println("Test : " + (System.currentTimeMillis() - start));
}
my result is: from 18 to 21 ms.
Third from bottom:
public static void main(String[] args) {
long start = System.currentTimeMillis();
for (int i=1; i <= 100000; i++)
{
ArrayList<String> foo = new ArrayList<String>();
foo.add("This is an item");
}
System.out.println("Test : " + (System.currentTimeMillis() - start));
}
result is: from 8 to 16ms.
Where is rest of that time gone?
But as I said - these tests don't make sense :)
#3 by Sean Corfield on 7/2/08 - 4:39 PM
#4 by Dave Ferguson on 7/2/08 - 6:57 PM
@Aaron I totally agree with you. My results is a total apples to oranges comparison. I would totally agree that some of the speed increase is due to the server. I also feel that if you are going to post performance data it should not be from tests on a notebook.
--Dave
#5 by Dave Ferguson on 7/2/08 - 6:58 PM
--Dave
#6 by radekg on 7/3/08 - 2:37 AM