Message-ID: <536833931.301577.1369142089907.JavaMail.firstname.lastname@example.org> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_301576_199869177.1369142089907" ------=_Part_301576_199869177.1369142089907 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
This benchmark compares a duck typed call to a normal call. Duck Typing calls are about 160 times = slower.
Boo's Duck Typing uses type.Inv= okeMember (System.Reflection), which can be very slow. To speed it up, you= need to replace the duck types with static type casts (see Casting Types) or type declarations ("x as= int").
See this thread= . In the example, a million items of unknown type are added to a list = after being upper-cased (if a string) or added (if an int).
Boo is pretty much as fast as other statically typed languages when you = use static typing. It takes only .34 seconds to do this example on my mach= ine.
But using Duck Typing or the -d= ucky option may make your code slower than regular Python (~1.5 seconds for= boo with duck typing vs. ~1 second for Python). About 50% slower in this = example. Note, I am not saying Python is slow. In fact Python + Psyco is = just as fast (.32s) as optimized C# code in this particular example.------=_Part_301576_199869177.1369142089907--