1 import Boo
.Lang
.Runtime
3 def benchmark(label
, method
as callable()):
5 for i
in range(5000000):
7 print "${label}\t", (date
.Now
-start
).TotalSeconds
15 static def addX(l
as List
, value
):
19 static length
[l
as List
]:
28 benchmark
"static int*int":
38 benchmark
"static List*int":
47 RuntimeServices
.WithExtensions(ListExtensions
):
48 benchmark
"extension List.Add":
52 benchmark
"static List.Add":
60 RuntimeServices
.WithExtensions(ListExtensions
):
61 benchmark
"extension property":
65 benchmark
"static property":
73 benchmark
"static indexer":
77 benchmark
"set field":
78 (Item() as duck
).name
= "foo"
80 benchmark
"static set field":
83 benchmark
"set property":
84 (Item() as duck
).name
= "foo"
86 benchmark
"static set property":