Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Perl script speed

by rr27 (Initiate)
on May 30, 2014 at 09:48 UTC ( [id://1087961]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl script speed
in thread Perl script speed

As evident, this is first time I am writing perl with SQLite, hence the inefficiency. I have done the profiling and got 1.DBI::st::execute as major time consumer. 2. DBD::SQLite::st::_prepare 3.DBI::_setup_handle. Please suggest ways to reduce the time.

Replies are listed 'Best First'.
Re^3: Perl script speed
by poj (Abbot) on May 30, 2014 at 11:50 UTC

    Try switching AutoCommit off and then use $dbh->commit() after say every 1000 inserts, adjusting the number to get the best result.
    This node might help Loading bulk data into SQLite

    poj
Re^3: Perl script speed
by Laurent_R (Canon) on May 30, 2014 at 10:42 UTC
    I would have expected that parsing a 34 MB file would not take very much time (at least not anything near 30 minutes) and that the DB inserts would likely be the big time consumers (but it is of course much better to check it with profiling tools). Well, davido has suggested some possible improvements here.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1087961]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-24 23:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found