This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
De-dup the output of git ls-files
[perl5.git] / t / perf / speed.t
CommitLineData
b5cbe44b
DM
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
14use strict;
15use warnings;
16use 5.010;
17
18sub run_tests;
19
20$| = 1;
21
22
23BEGIN {
24 chdir 't' if -d 't';
25 @INC = ('../lib');
26 require Config; import Config;
27 require './test.pl';
28}
29
30plan tests => 1;
31
32use warnings;
33use strict;
34
35watchdog(60);
36
37SKIP: {
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
511;