You can assume that the file read in the FileStorage
class of OpenCV is sufficiently well tuned for performance.
What you should be more worried about is, do you really need the niceties of FileStorage
. The disadvantage of using this method is that a full grammar YAML
/XML
parser will be run on your large file. This in my opinion will be far more slower than the time taken to actually read the file from disk.
My advise is that if you are really looking for fast reads from disks and immediate use (no parsing required), I would advise that you store your data in binary files. The advantage of using such files is that the only time spent is in reading the files, you dont have to parse these. You can read a C struct
or a C++ class
out of them straight away.
However, the downside is that if you do write your data to a binary file, you might face some really irritating errors when you migrate to another machine(different architecture), especially with endianness, or maybe even variable length of int
type. But in my view this will be rare, because most people use Intel or Intel compatible processors anyway.