Let me give just one datapoint:
#!/usr/bin/perl use strict; use warnings; undef $/; my $code = <DATA>; my $RUNS = 10; my $no_threads = "/opt/perl/bin/perl-64"; my $threads = "/opt/perl/bin/thr-perl-64"; foreach my $perl ($no_threads, $threads) { my ($sum_r, $sum_u) = (0, 0); foreach my $runs (0 .. $RUNS) { my $res = `/usr/bin/time -p $perl -e '$code' 2>&1 `; next unless $runs; $sum_r += ($res =~ /real\s*(\d+\.\d+)/)[0]; $sum_u += ($res =~ /user\s*(\d+\.\d+)/)[0]; } printf "real: %.2f; user: %.2f\n", $sum_r / $RUNS, $sum_u / $RUNS; } __DATA__ use strict; use warnings; foreach (1 .. 1000) { my @arr; foreach (1 .. 1000) { push @arr, 1; } } __END__ real: 0.43; user: 0.43 real: 0.54; user: 0.54
The short program, pushing '1' a thousand time on an array, takes about 25% more when threads are compiled in. Of course, YMMV.

In reply to Re^3: Approaches to concurrency by JavaFan
in thread Approaches to concurrency by tex

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.