Performance for creating millions of database entries
Prepare once. That's the very idea behind a prepared statement. It should give you like 5% gain.    

Wrap all batches in a single transaction. It could also help you in several ways. In case your engine is myisam, consider dropping all indexes before inserts and adding them back after.

Reduce the record size. 'parent' is 5 megabytes written on the disk for 1 mil records 1 megabyte if your value is 1.