c++ - What is the best way to binarize data -


I have some data files that are written as tag = values, where the tag is string and the value is numeric, string , Arrays, etc. I use this format because it is readable and can be easily edited Now every class that is used immediately by the use of this format is the load method and it reads the tags that need it and Use the values ​​found within these tags. I want to create data binary to increase the loading speed. In a way each class has a ToBinary (name does not matter) that reads the old data and writes it in a file and the new file is used to instantize the object. It can be offline, only once / application Do you have other suggestions for it? I use C ++ for this.

EDIT: I think that now the most expensive part is to parse the file when I first read it and to search for the tag that I did not read the file from the disk. . I can use custom file system to create many smaller files in a larger file.

I have a serialization base for this class, with small headers / with functions where Version handling can be embedded. I think this is a good system for simple data that needs to be stored locally and in most cases "read only"

something like this:

  Class SeralizeMe {Public: to Virtual Bull (archive and file) = 0; With Virtual Bull (archive and file) = 0; Virtual Bull Needs (Zero) = 0; }; However, do not use this system if you:  
  • Need to change the format often.
  • Need to select the data to load and what to store.
  • Use large files, which are sensitive to electricity decomposition during saving.

    If any of the above applies, then use the database, firebird SQL embedded is a suitable claimant.

Comments