File: speed.t

package info (click to toggle)
perl 5.42.0-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 128,392 kB
  • sloc: perl: 534,963; ansic: 240,563; sh: 72,042; pascal: 6,934; xml: 2,428; yacc: 1,360; makefile: 1,197; cpp: 208; lisp: 1
file content (45 lines) | stat: -rw-r--r-- 1,003 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!./perl
#
# All the tests in this file are ones that run exceptionally slowly
# (each test taking seconds or even minutes) in the absence of particular
# optimisations. Thus it is a sort of canary for optimisations being
# broken.
#
# Although it includes a watchdog timeout, this is set to a generous limit
# to allow for running on slow systems; therefore a broken optimisation
# might be indicated merely by this test file taking unusually long to
# run, rather than actually timing out.
#

BEGIN {
    chdir 't' if -d 't';
    @INC = ('../lib');
    require './test.pl';
}
use Config;

use strict;
use warnings;
use 5.010;

$| = 1;

plan tests => 1;

watchdog(60);

SKIP: {
    # RT #121975 / GH #13878 COW speedup lost after e8c6a474

    # without COW, this test takes minutes; with COW, its less than a
    # second
    #
    skip "PERL_NO_COW", 1 if $Config{ccflags} =~ /PERL_NO_COW/;

    my ($x, $y);
    $x = "x" x 1_000_000;
    $y = $x for 1..1_000_000;
    pass("COW 1Mb strings");
}

1;