Hello guys,
I'm working with DBD::CSV module and can't find the problem that eats a lot of memory, check this example:
#!/usr/bin/perl use DBI; our $st = DBI->connect('DBI:CSV:f_dir=.',{RaiseError=> 1}); my $check = $st->prepare(q{ SELECT COUNT(*) FROM list WHERE id=? LIMIT 1 }); my $a = 0; while ($a++ < 1000000) { $check->execute($a.('z' x 10)); print $a.('z' x 10)."\n"; } $check->finish(); $st->disconnect();
To make the list table use this:
#!/usr/bin/perl open F, '>','list'; print F "id\n"; for (0..1000000) { print F $_.('z' x 10)."\n"; } close F;
I hope that your computer is sufficiently slow to take several seconds to process this, if not, increase to 10 million or billon lines, even if you can't see anything, please gift me your pc ;-)...
somebody him to happened something similar?
What's can i do to decrease the use or better the hunger of memory and the cpu too, becouse it's really really slow.
In reply to DBD::CSV eats memory by perlmonkdr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |