> Your patch needs to account for PERL_IMPLICIT_SYS too like > t/op/fork.t does, as Schwern just pointed out.
Ok, ill look into that test to see how it works. > I should have mentioned that rather than just "ithreads" in my mail. > PERL_IMPLCIT_SYS is, in fact, also the reason that I don't build with > ActivePerl-style build options: enabling PERL_IMPLICIT_SYS > means that Perl's malloc cannot be used, so you get the system's > malloc() instead, which I've found several times to be absolutely crap on Win32. Ah ok, thanks. Ill check into that. So basically you are saying that unless you need fork you are probably better off using an unthreaded perl? > > For example, running this program (20 large extensions to a string): > > my $a = ''; > my $start = time; > for my $i (1 .. 20) { > print "$i\n"; > $a .= '.' x 8000000; > } > printf "OK (%d seconds)\n", time - $start; > > takes 1 second on my 5.8.6 with Perl malloc() versus 7 seconds using > ActivePerl Build 810 (5.8.4). > > And this program (500,000 small extensions to a string): > > my $a = ''; > my $start = time; > for my $i (1 .. 500000) { > print "$i\n" if $i % 1000 == 0; > $a .= '.' x 20; > } > printf "OK (%d seconds)\n", time - $start; > > is even worse: 1 second again on 5.8.6/perl-malloc versus 56 > seconds on > 5.8.4/system-malloc! Wow, ive been working on optimising some code recently that required very similar behaviour as these examples. Ill definately check out an unthreaded build. (Preallocating the full string and then substr()ing the snippets into place reduced the time massively) > > (I know that I'm not quite comparing apples with apples here, > but I have done so before using otherwise identically configured Perls > and it *is* the malloc() that makes the difference.) Thats really useful to know. Thank you. > > I do mean to investigate using ithreads without PERL_IMPLICIT_SYS > sometime (Perl's malloc works fine in that configuration), but that > doesn't give you the fork() emulation ;) Threading with a faster malloc sounds very nice. Anything I can do to motivate you on this? Single-malt maybe? ;-) Yves