I know this might seem obvious, I just want to make sure.
The process of looping a database and writing a blank file with fopen and fwrite versus reading a file with fread/fopen, appending to it (at the top, with seek).
Obviously at small filesizes fopen/fread will be faster than sql/pdo looping but I’m wondering if that fact stays the same when the amount of data grows to somewhat large proportions.
Any clues?
I benchmarked pdo looping vs fread/fwrite and it takes 4 ms to loop from db and write it versus 0 ms with fread/fwrite if there is 50 records in the table (10Kb of text data).
Wondering what would happen if I had 5.000 records. : ) anyone know?
oh and edit: for the purpose there’s no security issue whatsoever. Just plain raw speed.