A couple more ideas (sparked by the 80,000) :
- Try binding the return values. e.g.
my $imei;
$rc = $sth_imei->bind_col(0,\$imei);
$sth_imei->execute();
$sth_imei->fetch();
print "IMEI : $imei\n";
- If you don't want to do that, at least use ->fetchrow_arrayref(). Otherwise, each
execute call has to create a new list for you. The _arrayref
gives you a ref. to a static array, so less copying.
- bind_param should take a colum number shouldn't it, not a
name, e.g. $sth_imei->bind_param(0,$rec[1])
Either of the first 2 should save time, given 80,000 iterations.
Finally, note that execute() can return '0E0' meaning 0 but true,
meaning no rows (and different to undef for errors).
May be worth checking for that explicitly.
I think I'm out of ideas now...
--
Brovnik
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.