C
cyl
this block of code took about 25 seconds in my computer
open A,"a_500mb_file";
binmode A;
while(sysread(A,$x,256)){
#do nothing
}
close A;
and this took 215 seconds
open A,"a_500mb_file";
binmode A;
while(sysread(A,$x,256)){
my @c=unpack('C*',$x);
}
close A;
So why is unpack so slow here? I thought it very fast before. Do I use
it in a wrong way or is there any replacement? Thanks.
open A,"a_500mb_file";
binmode A;
while(sysread(A,$x,256)){
#do nothing
}
close A;
and this took 215 seconds
open A,"a_500mb_file";
binmode A;
while(sysread(A,$x,256)){
my @c=unpack('C*',$x);
}
close A;
So why is unpack so slow here? I thought it very fast before. Do I use
it in a wrong way or is there any replacement? Thanks.