J
Jindroush
Hi,
I have to load a file. I 'index' the records in two hashes. At the
beginning I do:
my $fl = -s $in;
my $recs = int( $fl / 85 );
keys( %$hr1 ) = $recs;
keys( %$hr2 ) = $recs if defined $hr2;
then for each record:
$$hr1{ lc $fname } = \%H;
if( defined $hr2 )
{
$$hr2{ $H{ hdr } . $H{ ent } } = \%H;
}
In %H is my data stored. This works good up to cca 70000 records (file1
has about 91000 records, each record is about 85 chars, split in 6
strings). Then it is _DEAD SLOW_. I load three such files in 3 (6)
different hashes. The two other files are also _DEAD SLOW_. I have quite
fast computer and s**tloads of free ram. Running: v5.6.1 built for
MSWin32-x86-multi-thread (activestate) on WXP (no way to change the perl
version/os).
Why is it so slow? How can I make it faster?
Regards,
Jindroush
I have to load a file. I 'index' the records in two hashes. At the
beginning I do:
my $fl = -s $in;
my $recs = int( $fl / 85 );
keys( %$hr1 ) = $recs;
keys( %$hr2 ) = $recs if defined $hr2;
then for each record:
$$hr1{ lc $fname } = \%H;
if( defined $hr2 )
{
$$hr2{ $H{ hdr } . $H{ ent } } = \%H;
}
In %H is my data stored. This works good up to cca 70000 records (file1
has about 91000 records, each record is about 85 chars, split in 6
strings). Then it is _DEAD SLOW_. I load three such files in 3 (6)
different hashes. The two other files are also _DEAD SLOW_. I have quite
fast computer and s**tloads of free ram. Running: v5.6.1 built for
MSWin32-x86-multi-thread (activestate) on WXP (no way to change the perl
version/os).
Why is it so slow? How can I make it faster?
Regards,
Jindroush