in reply to Why is Windows 100 times slower than Linux when growing a large scalar?

Compiling perl 5.10.1 without USE_IMP_SYS and with USE_PERL_MALLOC makes a huge difference. The following script grows two strings, each in a separate thread, to 1/2GB in 1000-byte increments in a little under 2 1/2 seconds:

#! perl -slw use strict; use Time::HiRes qw[ time ]; use threads; <>; my $start = time; async { my $s = chr(0) x 1000; for( 1 .. 5e5 ) { $s .= chr( 0 ) x 1000; } }->detach; my $s = chr(0) x 1000; for( 1 .. 5e5 ) { $s .= chr( 0 ) x 1000; } printf "Re-allocated 2 x 500MB (in 1000 byte incements) on two threads + in %.3f\n", time() - $start; <>; __END__ C:\perl\5.10.1\bin>.\perl.exe \test\mem.pl Re-allocated 2 x 500MB (in 1000 byte incements) on two threads in 2.41 +6

Now the question is: why is USE_IMP_SYS required for fork emulation? And can that be corrected?

Cluebats welcomed. Along with any thoughts on more thorough testing of Perl_malloc and threading.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP PCW It is as I've been saying!(Audio until 20090817)
  • Comment on Re: Why is Windows 100 times slower than Linux when growing a large scalar?
  • Download Code

Replies are listed 'Best First'.
Re^2: Why is Windows 100 times slower than Linux when growing a large scalar?
by Anonymous Monk on Dec 01, 2009 at 21:53 UTC

    Did you use Mingw or VC to compile Perl? Did you happen to run the performance test suite to see if there were any generic performance improvements with this perl?

    I too could lose fork emulation, as long as threads work:)

    Red.

      I used Microsoft (R) C/C++ Optimizing Compiler Version 15.00.21022.08 for x64. And Syphilis used MinGW.

      There's a Perl performance test suite? :)


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      No really. Could you point me to the "performance test suite" please? My searches haven't located anything likely.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        Perl benchmark suite -------------------- This is a Perl benchmark suite. It can be used to compare the relative speed of different versions of Perl. You run the benchmark by starting the 'perlbench-run' script giving the path-name of various Perls you want to test as argument. The perlbench-run program takes the following optional parameters: -s don't scale numbers (so that first perl is always 1 +00) -t <filter> only tests that match <filter> regex are timed -c <cpu-factor> use this factor to scale tests instead of running t +he 'cpu_factor' program to determine it. -d <dirname> what directory to save results in
        http://www.cpan.org/authors/id/GAAS/perlbench-0.93.readme