title: the fastest way to load data in C++
body: <p>There is a big object as an input in my program and i don't want to initialize it every time. So I have tried the Boost to serialize it(the object is 13.6 MB after serialized). But the performance is not very good. It still need about one minute to load and deserialize it. So I wonder is there any mehtod to make this process faster? I appreaciate any hints or suggestion! thank you in advance  </p>
  
  <p>this is the save function:</p>
  
  <pre><code>void mysave(){
      dataprepocess dp();//dp is the object i want to save and load
      ofstream ofs("dp.dat", ios::binary);
      {
          boost::archive::binary_oarchive oa(ofs);
          // write class instance to archive
          oa &lt;&lt; dp;
          // archive and stream closed when destructors are called
      }
      cout&lt;&lt;"saving finished"&lt;&lt;endl;
  }
  </code></pre>
  
  <p>here is my load function,</p>
  
  <pre><code>void myload(dataprepocess&amp; dp){
    ifstream ifs1("dp_b.dat", ios::binary);
    {
      boost::archive::binary_iarchive ia1(ifs1);
      ia1 &gt;&gt; dp;
    }
    ifs1.close();
  }
  </code></pre>
  
  <p>I have tried both text_archive and binary_arhive and it prove they don't have much difference in performance.</p>