[EMAIL PROTECTED] wrote: > hello all > > I need a fast concat solution. the following works, but it is extremely slow > and > it stutters. I am not replicating values, each value that is concatonated is > unique- the following is example does not illustrate this. > > about the stuttering...is this a buffering issue? it stutters (pauses) in, > what > looks like, random increments, though the first increment is 16 -- refer to > $count. I am running xp with Activestate 5.8. > > > my $count = 0; > > for(0..1125000) > { > $pmem::arr .= "#".$anewvalue; #$anewvalue is random; > $count++; > print $count,"\n"; > } > > > thanks in advance for all your help.
Run the below with output redirected to a file (like foo below) - it should give you an idea of how much CPU every 1000 iterations uses (in the file foo) and totals to the console : > perl test.pl >foo use strict; use warnings; print STDERR scalar (localtime), "\n"; my $pt0 = Win32::GetTickCount (); my $pt1 = $pt0; my $count = 0; my $anewvalue = '1234567890'; for (0 .. 1125000) { $pmem::arr .= "#" . $anewvalue; # $anewvalue is random; $count++; # print $count, "\n"; if ($count % 10000 == 0) { my $pt2 = Win32::GetTickCount (); printf "%.3f seconds\n", ($pt2 - $pt1) / 1000; $pt1 = $pt2; } } print STDERR scalar (localtime), "\n"; printf STDERR "%.3f seconds\n", (Win32::GetTickCount () - $pt0) / 1000; print STDERR "Length of \$pmem::arr = ", length $pmem::arr, "\n"; print STDERR substr ($pmem::arr, 0, 66), "\n"; print STDERR substr ($pmem::arr, -66, 66), "\n"; package pmem; my $arr = ''; __END__ _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs