testsuite: Update performance numbers for 32-bit platforms
[ghc.git] / testsuite / tests / perf / should_run / all.T
1 # T12791 and T5835 test that GHC uses top-level instances in places where using
2 # a locally given solution would produce worse code.
3 # See Note [Solving from instances when interacting Dicts]
4
5 test('T5835',
6      [stats_num_field('max_bytes_used',
7            [(wordsize(64), 44312, 10)]),
8        only_ways(['normal'])
9        ],
10      compile_and_run,
11      ['-O'])
12
13 test('T12791',
14      [stats_num_field('max_bytes_used',
15            [(wordsize(64), 44312, 10)]),
16        only_ways(['normal'])
17        ],
18      compile_and_run,
19      ['-O'])
20
21 # Tests that newArray/newArray_ is being optimised correctly
22
23 test('T10359',
24      [stats_num_field('bytes allocated',
25           [(wordsize(64), 450920, 5),
26            # previously   499512    (amd64/Linux)
27            # 2017-03-10   450920    (amd64/Linux)  Don't generate wrapper for !Int#
28            (wordsize(32), 351508, 5)]),
29       only_ways(['normal'])
30       ],
31      compile_and_run,
32      ['-O'])
33
34 # fortunately the values here are mostly independent of the wordsize,
35 # because the test allocates an unboxed array of doubles.
36 test('T3586',
37      [stats_num_field('peak_megabytes_allocated', (17, 1)),
38                                  # expected value: 17 (amd64/Linux)
39       stats_num_field('bytes allocated', (16102024, 5)),
40                         # prev:           16835544 (amd64/Linux)
41                         # 2014-07-17:     16102024 (amd64/Linux), general round of updates
42       only_ways(['normal']),
43
44       # Use `+RTS -G1` for more stable residency measurements. Note [residency].
45       # Only 64-bit as we don't have a good 32-bit test environment at the moment
46       when(wordsize(64), extra_hc_opts('+RTS -G1 -RTS'))
47       ],
48      compile_and_run,
49      ['-O'])
50
51 test('T4830',
52      [stats_num_field('bytes allocated',
53           [(wordsize(64), 98248, 4),
54            #             127000 (amd64/Linux)
55            # 2013-02-07:  99264 (amd64/Linux)
56            # 2014-01-13:  98248 (amd64/Linux) due to #8647
57            # 2015-04-03: Widen 1->4% (amd64/Windows was doing better)
58            (wordsize(32), 70646, 3)]),
59            # 2013-02-10:  69744 (x86/Windows)
60            # 2013-02-10:  71548 (x86/OSX)
61            # 2014-01-28:  Widen range 2->3
62            #                (x86/Windows - actual 69000, lower was 69233)
63       only_ways(['normal'])
64       ],
65      compile_and_run,
66      ['-O2'])
67
68 test('T3245', [when(doing_ghci(), extra_hc_opts('-fobject-code'))],
69      compile_and_run, ['-O'])
70
71 # Test that bytestring reading/writing isn't over-allocating.  We had
72 # a bug in hGetBufNonBlocking in 6.13 that triggered this.
73 #
74 test('lazy-bs-alloc',
75      [extra_files(['../../numeric/should_run/arith011.stdout']),
76       stats_num_field('peak_megabytes_allocated', (2, 1)),
77                                  # expected value: 2 (amd64/Linux)
78       stats_num_field('bytes allocated',
79           [(wordsize(64), 421792, 5),
80             #             489776 (amd64/Linux)
81             # 2013-02-07: 429744 (amd64/Linux)
82             # 2013-12-12: 425400 (amd64/Linux)
83             # 2015-04-04: Widen 1->3% (amd64/Windows was failing)
84             # 2015-08-15: 431500 (Windows not good enough. avg of Windows&Linux)
85             # 2015-12-15: 444720 (amd64/Linux, D1616)
86             # 2015-12-17: 444720 (widen 3->5%, Windows is at 462688)
87             # 2017-01-30: 421792 (amd64/Linux, strangely Type-indexed Typeable)
88            (wordsize(32), 410040, 5)]),
89             # 2013-02-10: 421296 (x86/Windows)
90             # 2013-02-10: 414180 (x86/OSX)
91             # 2014-01-22: 411500 (x86/Linux)
92             # 2014-01-28: Widen 1->2% (x86/Windows was at 425212)
93             # 2016-04-06: 429760 (x86/Linux) no idea what happened
94             # 2017-02-14: 421448 Early inline patch
95             # 2017-03-24: 410040 It's not entirely clear, widen threshold to match 64-bit case
96
97       only_ways(['normal']),
98       extra_run_opts('arith011.stdout'),
99       ignore_stdout,
100
101       # Use `+RTS -G1` for more stable residency measurements. Note [residency].
102       # Only 64-bit as we don't have a good 32-bit test environment at the moment
103       when(wordsize(64), extra_hc_opts('+RTS -G1 -RTS'))
104       ],
105      # use a suitably big file, without bloating the repo with a new one:
106      compile_and_run,
107      ['-O'])
108
109 test('T876',
110      [stats_num_field('bytes allocated',
111           [(platform('x86_64-unknown-mingw32'), 66928, 5),
112               # 2015-04-03: 71904 (amd64/Windows, unknown cause)
113               # 2016-11-27: 66928 (amd64/Windows, unknown cause)
114            (wordsize(64), 58128, 5),
115               # 2013-02-14: 1263712 (x86_64/Linux)
116               # 2014-02-10:   63216 (x86_64/Linux), call arity analysis
117               # 2016-11-11:   58128 (x86_64/Linux), it's not clear
118
119            (wordsize(32), 50408, 5) ]),
120               # some date:  663712  (Windows, 64-bit machine)
121               # 2014-04-04:  56820  (Windows, 64-bit machine)
122               # 2014-06-29:  53024  (x86_64/Linux)
123               # 2014-12-01:  56796  (Windows)
124               # 2015-07-11:  53156  (x86_64/Linux)
125               # 2017-03-24:  50408  (x86/Linux, 64-bit machine)
126
127       only_ways(['normal']),
128       extra_run_opts('10000')
129       ],
130      compile_and_run,
131      ['-O'])
132
133 # Get reproducible floating-point results on x86
134 if config.arch == 'i386':
135    sse2_opts = '-msse2'
136 else:
137    sse2_opts = ''
138
139 test('T4321',
140      omit_ways(['ghci']),
141      compile_and_run, ['-O ' + sse2_opts])
142
143 test('T3736', [], run_command, ['$MAKE -s --no-print-directory T3736'])
144 test('T3738',
145      [extra_clean(['T3738a.hi', 'T3738a.o']),
146       stats_num_field('peak_megabytes_allocated', (2, 0)),
147                     # expected value: 1 (amd64/Linux)
148                     # 2016-08-31:     2 (allocation area size bumped to 1MB)
149       stats_num_field('bytes allocated',
150                       [(wordsize(32), 45648, 5),
151                     # expected value: 50520 (x86/Linux)
152                        (wordsize(64), 50592, 8)]),
153                     # prev:           49400 (amd64/Linux)
154                     # 2014-07-17:     50520 (amd64/Linux) general round of updates
155                     # 2014-09-10:     50592 (amd64/Linux) post-AMP-update
156                     # 2015-04-03: Widen 5->8% (amd64/Windows was doing better)
157       only_ways(['normal'])
158       ],
159      compile_and_run,
160      ['-O'])
161
162 test('MethSharing',
163      [stats_num_field('peak_megabytes_allocated', (2, 0)),
164                     # expected value: 1 (amd64/Linux)
165                     # 2016-08-31:     2 (allocation area size bumped to 1MB)
166       stats_num_field('bytes allocated',
167                       [(wordsize(32), 240071008, 5),
168                     # expected value: 2685858140 (x86/OS X)
169                     # expected:       360940756 (x86/Linux)
170                     # 2017-03-24:     240071008 (x86/Linux, 64-bit machine)
171                        (wordsize(64), 480098192, 5)]),
172                     # expected:   640067672 (amd64/Linux)
173                     # 2017-01-31: 480098192 work/wrap noinline things
174       only_ways(['normal'])
175       ],
176      compile_and_run,
177      ['-O'])
178 test('T2902', [], run_command, ['$MAKE -s --no-print-directory T2902'])
179 test('T149',
180      [ # expect_broken(149),
181        # working (2 Jul 2013, x86-64/Linux)
182       extra_clean(['T149_A',    'T149_B',
183                    'T149_A.hi', 'T149_B.hi',
184                    'T149_A.o',  'T149_B.o'])],
185      run_command,
186      ['$MAKE -s --no-print-directory T149'])
187
188 test('T5113',
189      [stats_num_field('bytes allocated',
190                       [(wordsize(32), 4000000, 5),
191                        (wordsize(64), 8000000, 5)]),
192       only_ways(['normal'])
193       ],
194      compile_and_run,
195      ['-O'])
196
197
198 test('T4978',
199      [stats_num_field('bytes allocated',
200                       [(wordsize(32), 10000000, 5),
201                        (wordsize(64), 10137680, 5)]),
202                     # expected value: 10137680 (amd64/Linux)
203       only_ways(['normal'])
204       ],
205      compile_and_run,
206      ['-O2'])
207
208 test('T5205',
209      [stats_num_field('bytes allocated',
210                       [(wordsize(32), 49460, 5),
211                     # expected value: 47088 (x86/Darwin)
212                     # 2017-03-24:     49460 (x86/Linux, 64-bit machine)
213
214                        (platform('x86_64-unknown-mingw32'), 52264, 5),
215                     # 2016-12-14: 52264 (Separate out Windows results)
216
217                        (wordsize(64), 56208, 5)]),
218                     # expected value: 51320 (amd64/Linux)
219                     # 2014-07-17:     52600 (amd64/Linux) general round of updates
220                     # 2015-04-03: Widen 5->7% (amd64/Windows was doing better)
221                     # 2015-08-15: 50648 (Windows too good. avg of Windows&Linux)
222                     # 2015-10-30: 56208 (D757: Emit Typeable at definition site)
223                     # 2016-12-14: Narrow 7->5% (Separate out Windows results)
224       only_ways(['normal', 'optasm'])
225       ],
226      compile_and_run,
227      [''])
228
229 test('T5549',
230      [stats_num_field('bytes allocated',
231                       [(wordsize(32), 2896607976, 5),
232                     # expected value: 3362958676 (Windows)
233                     # 2014-12-01:     4096606332 (Windows) integer-gmp2
234                     # 2017-03-24:     2896607976 (x86/Linux, 64-bit machine)
235
236                        (wordsize(64), 5793140200, 5)]),
237                     # expected value: 6725846120 (amd64/Linux)
238                     #                 8193140752 (amd64/Linux) integer-gmp2
239                     #                 5793140200 (amd64/Linux) integer-gmp2
240       only_ways(['normal'])
241       ],
242      compile_and_run,
243      ['-O'])
244
245 test('T4474a',
246      [stats_num_field('bytes allocated',
247                       [(wordsize(32), 2405242767, 5),
248                        (wordsize(64), 4831890304, 5)]),
249                     # expected value: 4831890304 (amd64/OSX)
250       only_ways(['normal'])
251       ],
252      compile_and_run,
253      ['-O'])
254 test('T4474b',
255      [stats_num_field('bytes allocated',
256                       [(wordsize(32), 2405242767, 5),
257                        (wordsize(64), 4831890304, 5)]),
258                     # expected value: 4831890304 (amd64/OSX)
259       only_ways(['normal'])
260       ],
261      compile_and_run,
262      ['-O'])
263 test('T4474c',
264      [stats_num_field('bytes allocated',
265                       [(wordsize(32), 2405242767, 5),
266                        (wordsize(64), 4831890304, 5)]),
267                     # expected value: 4831890304 (amd64/OSX)
268       only_ways(['normal'])
269       ],
270      compile_and_run,
271      ['-O'])
272
273 test('T5237',
274      [stats_num_field('bytes allocated',
275                         [(platform('i386-unknown-mingw32'), 73280, 5),
276                          (wordsize(32), 78328, 5),
277                       # expected value: 78328 (i386/Linux)
278                          (wordsize(64), 104176, 5)]),
279                       # expected value: 110888 (amd64/Linux)
280                       # expected value: 104176 (amd64/Linux)
281      only_ways(['normal'])
282      ],
283     compile_and_run,
284     ['-O ' + sse2_opts])
285
286 test('T5536',
287      [stats_num_field('bytes allocated',
288                       [(wordsize(32), 446260520, 1),
289                                    # 1246287228 (i386/Linux)
290                                     # 446328556 (i386/Windows)
291                                     # 446192484 (i386/OSX)
292                        (wordsize(64), 892399040, 5)]),
293                    # expected value: 2492589480 (amd64/Linux)
294                    # 17/1/13:         892399040 (x86_64/Linux)
295                    #                  (new demand analyser)
296      extra_clean(['T5536.data']),
297      ignore_stdout,
298      only_ways(['normal'])
299      ],
300     compile_and_run,
301     ['-O'])
302
303 test('T7257',
304      [stats_num_field('bytes allocated',
305                       [(wordsize(32), 869850704, 10),
306                         # expected value: 1246287228 (i386/Linux)
307                         # 2016-04-06: 989850664 (i386/Linux) no idea what happened
308                         # 2017-03-25: 869850704 (x86/Linux, 64-bit machine) probably sizeExpr fix
309                        (wordsize(64), 1414893248, 5)]),
310                         # 2012-09-21: 1774893760 (amd64/Linux)
311                         # 2015-11-03: 1654893248 (amd64/Linux)
312                         # 2016-06-22: 1414893248 (amd64/Linux, sizeExpr fix)
313       stats_num_field('peak_megabytes_allocated',
314                       [(wordsize(32), 217, 5),
315                         # 2012-10-08: 217 (x86/Linux)
316                        (wordsize(64), 227, 5)]),
317                         # 2012-09-21: 227 (amd64/Linux)
318
319       only_ways(['normal'])
320      ],
321     compile_and_run, ['-O'])
322
323 test('Conversions',
324      [stats_num_field('bytes allocated',
325                       [(wordsize(32), 76768, 3),
326                         # 2012-12-18: 55316 Guessed 64-bit value / 2
327                         # 2013-02-10: 77472 (x86/OSX)
328                         # 2013-02-10: 79276 (x86/Windows)
329                         # 2014-01-13: 76768 (x86/Linux) due to #8647
330                        (wordsize(64), 107544, 5)]),
331                         # 2012-12-18: 109608 (amd64/OS X)
332                         # 2014-07-17: 107544 (amd64/Linux)
333
334       only_ways(['normal'])
335      ],
336     compile_and_run, ['-O -msse2'])
337
338 test('T7507', omit_ways(['ghci']), compile_and_run, ['-O'])
339 # For 7507, stack overflow is the bad case
340
341 test('T7436',
342      [stats_num_field('max_bytes_used',
343           [(wordsize(64), 60360, 4),
344            #             127000 (amd64/Linux)
345            # 2013-02-07:  60360 (amd64/Linux)
346            # 2015-04-03: Widen 1->4% (amd64/Windows was doing better)
347            (wordsize(32), 42772, 1)]),
348             # 2013-02-10: 58032 (x86/Windows)
349             # 2013-02-10: 58836 (x86/OSX)
350             # 2017-03-24: 42772 (x86/Linux, 64-bit machine) no idea why
351       only_ways(['normal'])
352       ],
353      compile_and_run,
354      ['-O'])
355
356 test('T7797',
357       [stats_num_field('bytes allocated',
358                       [(wordsize(32), 240044984, 5),
359                           # expected value: 2685858140 (x86/OS X)
360                           # expected: 360940756 (x86/Linux)
361                           # expected: 240044984 (x86/Windows, 64bit machine)
362                        (wordsize(64), 480050944, 5)]),
363                           # expected: 480050944 (amd64/Linux)
364       extra_clean(['T7797a.hi', 'T7797a.o']),
365       only_ways(['normal'])
366       ],
367      compile_and_run,
368      ['-O'])
369
370 test('T7954',
371       [stats_num_field('bytes allocated',
372                       [(wordsize(32), 920045264, 10),
373               # some date:  1380051408    (64-bit Windows machine)
374               # 2014-04-04:  920045264    (64-bit Windows machine)
375                        (wordsize(64), 1680051336, 10)]),
376               # 2014-02-10: 1680051336 (x86_64/Linux), call arity analysis
377       only_ways(['normal'])
378       ],
379      compile_and_run,
380      ['-O'])
381
382 test('T7850',
383      [stats_num_field('peak_megabytes_allocated',
384                       [(wordsize(32), 2, 10),
385                        (wordsize(64), 4, 10)]),
386       only_ways(['normal'])],
387      compile_and_run,
388      ['-O'])
389
390 test('T5949',
391      [stats_num_field('bytes allocated',
392                       [ (wordsize(32), 116020, 10),
393                         (wordsize(64), 201008, 10)]),
394                       # previously, it was >400000 bytes
395       only_ways(['normal'])],
396      compile_and_run,
397      ['-O'])
398
399 test('T4267',
400      [stats_num_field('bytes allocated',
401                       [ (wordsize(32), 36012, 10)
402                       # 32-bit value close to 64 bit; c.f. T7619
403                       , (wordsize(64), 40992, 10) ]),
404                       # previously, it was >170000 bytes
405                       # 2014-01-17: 130000
406                       # 2014-02-10: 40992 (x86_64/Linux), call arity analysis
407       only_ways(['normal'])],
408      compile_and_run,
409      ['-O'])
410
411 test('T7619',
412      [stats_num_field('bytes allocated',
413                       [ (wordsize(32), 36012, 10)
414                       # 32-bit close to 64-bit value; most of this very
415                       # small number is standard start-up boilerplate I think
416                       , (wordsize(64), 40992, 10) ]),
417                       # previously, it was >400000 bytes
418       only_ways(['normal'])],
419      compile_and_run,
420      ['-O'])
421
422 test('InlineArrayAlloc',
423      [stats_num_field('bytes allocated',
424                       [ (wordsize(32), 800040960, 5)
425                       , (wordsize(64), 1600040960, 5) ]),
426       only_ways(['normal'])],
427      compile_and_run,
428      ['-O2'])
429
430 test('InlineByteArrayAlloc',
431      [stats_num_field('bytes allocated',
432                       [ (wordsize(32), 1360036012, 5)
433                       , (wordsize(64), 1440040960, 5) ]),
434          # 32 and 64 bit not so different, because
435          # we are allocating *byte* arrays
436       only_ways(['normal'])],
437      compile_and_run,
438      ['-O2'])
439
440 test('InlineCloneArrayAlloc',
441      [stats_num_field('bytes allocated',
442                       [ (wordsize(32), 800041120, 5)
443                       , (wordsize(64), 1600041120, 5) ]),
444       only_ways(['normal'])],
445      compile_and_run,
446      ['-O2'])
447
448 test('T9203',
449      [stats_num_field('bytes allocated',
450                       [ (wordsize(32), 77969268, 5)
451                       # was
452                       # 2016-04-06     84345136 (i386/Debian) not sure
453                       # 2017-03-24     77969268 (x86/Linux, 64-bit machine) probably join points
454
455                       , (wordsize(64), 84620888, 5) ]),
456                       # was            95747304
457                       # 2019-09-10     94547280 post-AMP cleanup
458                       # 2015-10-28     95451192 emit Typeable at definition site
459                       # 2016-12-19     84620888 Join points
460       only_ways(['normal'])],
461      compile_and_run,
462      ['-O2'])
463
464 test('T9339',
465      [stats_num_field('bytes allocated',
466                       [ (wordsize(32),    46904, 5)
467                       # is this number correct? Seems very high.
468                       # 2017-03-24:       46904 (x86/Linux, 64-bit machine) who knows
469
470                       , (platform('x86_64-unknown-mingw32'), 47088, 7)
471                       # 2017-02-19                           47088 (x64/Windows) - Unknown
472
473                       , (wordsize(64),       50728, 5) ]),
474                       # w/o fusing last: 320005080
475                       # 2014-07-22:       80050760
476                       # 2016-08-17:          50728 Join points (#12988)
477       only_ways(['normal'])],
478      compile_and_run,
479      ['-O2 -fspec-constr-keen'])
480      # For the -fspec-constr-keen see Note [Making SpecConstr keener] in SpecConstr
481
482
483 test('T8472',
484      [stats_num_field('bytes allocated',
485                       [ (wordsize(32),    50000, 80)
486                       , (wordsize(64),    51424, 80) ]),
487       only_ways(['normal'])],
488      compile_and_run,
489      ['-O2'])
490
491 test('T12996',
492      [stats_num_field('bytes allocated',
493                       [ (wordsize(64),    76776, 5) ]),
494       only_ways(['normal'])],
495      compile_and_run,
496      ['-O2'])
497
498 test('T13001',
499      [stats_num_field('bytes allocated',
500                       [ (wordsize(32),    46728, 20)
501                       , (wordsize(64),    50600, 20) ]),
502       only_ways(['normal'])],
503      compile_and_run,
504      ['-O2'])
505
506 test('T12990',
507     [stats_num_field('bytes allocated',
508                      [ (wordsize(64), 20040936, 5) ]),
509                      # 2017-01-03     34440936  w/o inlining unsaturated
510                      #                          constructor wrappers
511                      # 2017-01-03     21640904 inline wrappers
512                      # 2017-01-31     20040936 work/wrap noinline things
513      only_ways(['normal'])],
514     compile_and_run,
515     ['-O2'])
516
517 test('T13218',
518     [stats_num_field('bytes allocated',
519                      [ (wordsize(64), 82040056, 5) ]),
520                      # 8.1 with default <$  163644216
521                      # 8.1 with derived <$   82040056
522      stats_num_field('max_bytes_used',
523                      [ (wordsize(64), 359128, 10) ]),
524                      # 8.1 with default <$  64408248
525                      # 8.1 with derived <$    359128
526      only_ways(['normal'])],
527     compile_and_run,
528     ['-O'])