| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 | Test | Chrome 26 | Firefox 20 | IE 9 | FP 11.6 (ASC1) | FP 11.6 (ASC2) | ||||||||||||||
9 | 1 | array.join | 5 | 30 | 30 | 143 | 148 | |||||||||||||
10 | 2 | array.sort | 450 | 50 | 100 | 145 | 145 | |||||||||||||
11 | 3 | string concat | 2300 | 1910 | 6500 | 36 | 37 | |||||||||||||
12 | 4 | long concat (too inconsistent) | ||||||||||||||||||
13 | 5 | harmonic (flops) | 150 | 130 | 185 | 115 | 115 | |||||||||||||
14 | 6 | substring | 45 | 40 | 65 | 116 | 110 | |||||||||||||
15 | 7 | string indexOf | 180 | 330 | 330 | 340 | 345 | |||||||||||||
16 | 8 | Math.round | 65 | 60 | 3250 | 180 | 186 | |||||||||||||
17 | 9 | empty loop | 130 | 130 | 100 | 200 | 175 | |||||||||||||
18 | 10 | func + string + array | 60 | 60 | 90 | 163 | 162 | |||||||||||||
19 | 11 | md5 cupcake | 110 | 120 | 320 | 106 | 104 | |||||||||||||
20 | 12 | func call with return | 17 | 17 | 130 | 113 | 17 | |||||||||||||
21 | ||||||||||||||||||||
22 | ||||||||||||||||||||
23 | x Chrome faster than ASC2 | x Firefox faster than ASC2 | x IE faster than ASC2 | x ASC2 faster than slowest browser | x Fastest browser faster than ASC2 | |||||||||||||||
24 | 1 | array.join | 29.60 | 4.93 | 4.93 | 0.20 | 29.60 | |||||||||||||
25 | 2 | array.sort | 0.32 | 2.90 | 1.45 | 3.10 | 2.90 | |||||||||||||
26 | 3 | string concat | 0.02 | 0.02 | 0.01 | 175.68 | 0.02 | |||||||||||||
27 | 4 | long concat (too inconsistent) | #DIV/0! | #DIV/0! | #DIV/0! | #DIV/0! | #DIV/0! | |||||||||||||
28 | 5 | harmonic (flops) | 0.77 | 0.88 | 0.62 | 1.61 | 0.88 | |||||||||||||
29 | 6 | substring | 2.44 | 2.75 | 1.69 | 0.59 | 2.75 | |||||||||||||
30 | 7 | string indexOf | 1.92 | 1.05 | 1.05 | 0.96 | 1.92 | |||||||||||||
31 | 8 | Math.round | 2.86 | 3.10 | 0.06 | 17.47 | 3.10 | |||||||||||||
32 | 9 | empty loop | 1.35 | 1.35 | 1.75 | 0.74 | 1.75 | |||||||||||||
33 | 10 | func + string + array | 2.70 | 2.70 | 1.80 | 0.56 | 2.70 | |||||||||||||
34 | 11 | md5 cupcake | 0.95 | 0.87 | 0.33 | 3.08 | 0.95 | |||||||||||||
35 | 12 | func call with return | 1.00 | 1.00 | 0.13 | 7.65 | 1.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 at | possibly 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 | ||||||||||||||||||||