eosnetworkfoundation / mandel.cdt

Obsolete. Use https://github.com/AntelopeIO/cdt instead.
Other
7 stars 2 forks source link

Slow deserialization for std::vector<unsigned char> #48

Closed elmato closed 2 years ago

elmato commented 2 years ago

When deserializing a std::vector of unsigned char it will fall into the generic datastream operator for vectors, making the deserialization of a large array too slow

template<typename Stream, typename T>
datastream<Stream>& operator << ( datastream<Stream>& ds, const std::vector<T>& v ) {
   ds << unsigned_int( v.size() );
   for( const auto& i : v )
      ds << i;
   return ds;
}
stephenpdeos commented 2 years ago

Potential candidate for rc3 but not a release blocker

linh2931 commented 2 years ago

This was fixed by https://github.com/AntelopeIO/cdt/pull/27.