Forum Moderators: phranque
Any ideas would be appreciated.
Personally I would expect most of the overhead from an INSERT operation would be from the database itself, with the time directly attributable to the responsible programming language being negligible. The INSERT operation is probably where you will be able to optimize the most.
If you're using MySQL with the default MyISAM tables, you should be aware these can be very slow on INSERTs, especially if you have indexes.