This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_leavesub(): call FREETMPS and optimise
[perl5.git] / t / perf / speed.t
1 #!./perl
2 #
3 # All the tests in this file are ones that run exceptionally slowly
4 # (each test taking seconds or even minutes) in the absence of particular
5 # optimisations. Thus it is a sort of canary for optimisations being
6 # broken.
7 #
8 # Although it includes a watchdog timeout, this is set to a generous limit
9 # to allow for running on slow systems; therefore a broken optimisation
10 # might be indicated merely by this test file taking unusually long to
11 # run, rather than actually timing out.
12 #
13
14 use strict;
15 use warnings;
16 use 5.010;
17
18 sub run_tests;
19
20 $| = 1;
21
22
23 BEGIN {
24     chdir 't' if -d 't';
25     @INC = ('../lib');
26     require Config; import Config;
27     require './test.pl';
28 }
29
30 plan tests => 1;
31
32 use warnings;
33 use strict;
34
35 watchdog(60);
36
37 SKIP: {
38     # RT #121975 COW speedup lost after e8c6a474
39
40     # without COW, this test takes minutes; with COW, its less than a
41     # second
42     #
43     skip  "PERL_NO_COW", 1 if $Config{ccflags} =~ /PERL_NO_COW/;
44
45     my ($x, $y);
46     $x = "x" x 1_000_000;
47     $y = $x for 1..1_000_000;
48     pass("COW 1Mb strings");
49 }
50
51 1;