My code looks like this:
// Connect to SQLite DB DB(\'/path/to/sqlite.db\'); DB(\'BEGIN TRANSACTION;\'); // These loops are just examples. for ($i = 1; $i
The DB function as originally posted issues a filesystem stat() system call each time it is run to check if the query string is a file. While that isn't solely responsible for the slow execution, it contributes to it.