OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // VMOptions=--optimization-counter-threshold=-1 --new_gen_semi_max_size=2 | 5 // VMOptions=--optimization-counter-threshold=-1 --new_gen_semi_max_size=2 |
6 | 6 |
| 7 // TODO(rnystrom): This looks like a VM-specific test. Move out of |
| 8 // tests/language and into somewhere more appropriate. |
| 9 |
7 import 'dart:math'; | 10 import 'dart:math'; |
8 | 11 |
9 main() { | 12 main() { |
10 // 2MB / 16 bytes = 125000 allocations | 13 // 2MB / 16 bytes = 125000 allocations |
11 | 14 |
12 for (var i = 0; i < 500000; i++) { | 15 for (var i = 0; i < 500000; i++) { |
13 sin(i); | 16 sin(i); |
14 } | 17 } |
15 | 18 |
16 for (var i = 0; i < 500000; i++) { | 19 for (var i = 0; i < 500000; i++) { |
17 cos(i); | 20 cos(i); |
18 } | 21 } |
19 | 22 |
20 for (var i = 0; i < 500000; i++) { | 23 for (var i = 0; i < 500000; i++) { |
21 i.toDouble().truncateToDouble(); | 24 i.toDouble().truncateToDouble(); |
22 } | 25 } |
23 } | 26 } |
OLD | NEW |