Depending on your database, consider bulk loading.
MySQL has LOAD DATA INFILE
SQL Server has BULK INSERT
They're very particular. Data has to be in the right format for this to work, but these are typically magnitudes faster than running through any processor.