The fastest is not always the best for your application.
Generally, when it comes to data recovery, it is recommended to use the database.
In a database you can select the record you want to read, already a file that is more difficult.
Of course all this depends on the use case. I would not use, for example, the database to save data from the webservice connection of my system. I could do this in a configuration file simply.
As was said in a comment, you have to make a balance to know which of the two meets the need most.
Worrying too much about performance can sometimes be more damaging than beneficial. I fully agree with the "doctrine of balance" in this case.
Now, I’m not saying we should totally ignore it (the performance). If you are going to use a database, you should do the right procedures so that it does not become a burden for the system (I’m talking about poorly constructed queries, lack of indexes).
In the end, I do not think it is convenient to make comparisons between the two modes, since each one depends on how and in what you will apply. If it doesn’t become the same discussion of POO vs procedural programming.
In my opinion you should first make a balance! You have to see which type is most useful to you, because not always the fastest is the best to work.
– ivan veloso