Gossamer Forum
Home : General : Perl Programming :

Speeding up an import...

Quote Reply
Speeding up an import...
Hi. I have this script working, but it seems quite slow.

Basically, I now have the Amazon XML feed, and I'm "parsing" the data as follows;

Use a while() to go through the main 1Gb+ XML file, and split into smaller .xml files, which are then "cleaned" out to a Tab delimited file (to save space, and theoretically minamise the amount of memory each file takes up in memory when slurping it into memory).

I then use a while() loop to go through each of the smaller files (5,000 records per .db file, which works out about 5-10Mb).

So far, its does about 2-3 items per second, which sounds ok... but on 1,000,000+ products, thats several days for it to complete :(

I've tried cleaning out old variables (to fee up memory), but it still doesn't seem to be going that quick (I was hoping for at least 10 items per second).

Anyone got any suggestions on speeding it up, or do you think thats about the best I'm gonna be able to get? I *really* want to speed it up if possible (as long as it doesn't include a full rewrite Tongue).

TIA.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Speeding up an import... Andy 9961 May 29, 2004, 3:05 AM
Thread Re: [Andy] Speeding up an import...
Jarrod 9703 May 30, 2004, 5:38 PM
Post Re: [Jarrod] Speeding up an import...
Andy 9645 May 31, 2004, 12:16 AM
Thread Re: [Andy] Speeding up an import...
Wil 9711 May 31, 2004, 8:41 AM
Thread Re: [Wil] Speeding up an import...
Andy 9699 May 31, 2004, 9:29 AM
Thread Re: [Andy] Speeding up an import...
Alex 9791 May 31, 2004, 10:31 AM
Thread Re: [Alex] Speeding up an import...
Andy 9659 May 31, 2004, 12:50 PM
Thread Re: [Andy] Speeding up an import...
Alex 9692 May 31, 2004, 12:52 PM
Thread Re: [Alex] Speeding up an import...
lanerj 9717 May 31, 2004, 9:00 PM
Post Re: [lanerj] Speeding up an import...
Alex 9640 Jun 1, 2004, 9:05 AM
Thread Re: [Andy] Speeding up an import...
Dinky 9689 Jun 1, 2004, 2:57 PM
Post Re: [Dinky] Speeding up an import...
Andy 9605 Jun 4, 2004, 6:44 AM