Skip to content
This repository
branch: nqp_pct
Fetching contributors…

Cannot retrieve contributors at this time

file 79 lines (63 sloc) 1.161 kb
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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
# Copyright (C) 2001-2006, Parrot Foundation.

=head1 NAME

examples/benchmarks/freeze.pasm - Freeze/Thaw Benchmarks

=head1 SYNOPSIS

    % time ./parrot examples/benchmarks/freeze.pasm

=head1 DESCRIPTION

Freeze/thaw an ResizablePMCArray.

=cut

.pcc_sub :main main:
    new P0, 'ResizablePMCArray'
    set I0, 100000
    time N0
lp1:
    push P0, I0
    dec I0
    if I0, lp1
    time N1
    sub N1, N0
    print "constr.time "
    print N1
    print "\n"

    time N0
    freeze S0, P0
    time N1
    sub N1, N0
    print "freeze time "
    print N1
    print "\n"
    # print S0
    # print "\n"

    time N0
    thaw P10, S0
    time N1
    sub N1, N0
    print " thaw time "
    print N1
    print "\n"

# time N0
# clone P11, P0
# time N1
# sub N1, N0
# print " clone time "
# print N1
# print "\n"

    print "Image len "
    length I0, S0
    print I0
    print "\n"
    typeof S10, P10
    print S10
    print " "
    set I11, P10
    print I11
    print "\n"
    end

=head1 SEE ALSO

F<examples/benchmarks/freeze.pl>.

=cut

# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:
Something went wrong with that request. Please try again.