I made a few tests, first I tested mysql prepared statement with $pdo->prepare() and $insert_sth->execute() for 10k inserts (with named parameters if it matters), and it took 301s.
After that I made simple insert queries and inserting each time for the same 10k inserts too and it took 303s.
So I would like to know: does prepared statements really give performance benefits? Because my tests didn’t show it , or I have to optimize my prepared statements version in order for them to be they faster?
I can give my source code if it’s needed.
INSERTs are most likely IO-bound, since they’re generally not very complex in terms of SQL – just a list of columns and data to put in them. Thus, what you use to perform the queries isn’t as significant in the run time as the amount of data that you’re stuffing into the database, how fast you can get the data to the DB server, and how fast the DB server can store it.