ABCDEFGHIJKLMNOPQRST
1
Rewritten / adjusted tests from http://jacksondunstan.com/articles/2209
2
3
ARTIFICIAL TESTS CAN BE MISLEADING
4
ESPECIALLY THESE ONES D:
5
6
Tested on Windows 7 with a Q6600 at 2.6GHz
7
8
TestChrome 26Firefox 20IE 9FP 11.6 (ASC1)FP 11.6 (ASC2)
9
1array.join53030143148
10
2array.sort45050100145145
11
3string concat2300191065003637
12
4long concat (too inconsistent)
13
5harmonic (flops)150130185115115
14
6substring454065116110
15
7string indexOf180330330340345
16
8Math.round65603250180186
17
9empty loop130130100200175
18
10func + string + array606090163162
19
11md5 cupcake110120320106104
20
12func call with return171713011317
21
22
23
x Chrome faster than ASC2x Firefox faster than ASC2x IE faster than ASC2x ASC2 faster than slowest browserx Fastest browser faster than ASC2
24
1array.join29.604.934.930.2029.60
25
2array.sort0.322.901.453.102.90
26
3string concat0.020.020.01175.680.02
27
4long concat (too inconsistent)#DIV/0!#DIV/0!#DIV/0!#DIV/0!#DIV/0!
28
5harmonic (flops)0.770.880.621.610.88
29
6substring2.442.751.690.592.75
30
7string indexOf1.921.051.050.961.92
31
8Math.round2.863.100.0617.473.10
32
9empty loop1.351.351.750.741.75
33
10func + string + array2.702.701.800.562.70
34
11md5 cupcake0.950.870.333.080.95
35
12func call with return1.001.000.137.651.00
36
37
38
39
40
Note: browser results were pretty inconsistent, jumping a lot more wildly than FP, so take that into account (sometimes it would go from 60ms to 16ms to the weird 2s)
41
Note: sometimes the browser (e.g. Firefox on #8) would hang for 2 seconds on the same test that would take 60ms otherwise, I have no idea what would cause that; in Firefox it even repeated several times in a row until I refreshed
42
43
Conclusion
44
From the small very artificial test set above:
45
Browsers seem better at automatic inlining, string functions and optimizing loops (or general overhead when looping)
46
AVM seems better atpossibly string concatenation, lots of raw number crunching (Vector + uint) and flops (floating point operations)
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100