Skip to content

Instantly share code, notes, and snippets.

@motonacciu
Last active December 17, 2015 11:39
Show Gist options
  • Select an option

  • Save motonacciu/5603592 to your computer and use it in GitHub Desktop.

Select an option

Save motonacciu/5603592 to your computer and use it in GitHub Desktop.
TEST(Performance, Water) {
auto t1 = std::tuple<int,uint64_t,std::vector<uint8_t>,std::string>(
10, 20, std::vector<uint8_t>{0,1,2,3,4,5,6,7,8,9},"hello cpp-love!");
auto start = std::chrono::high_resolution_clock::now();
for (size_t i=0; i<500000; ++i) {
StreamType res;
serialize(t1,res);
auto t2 = deserialize<decltype(t1)>(res);
if (t1!=t2) { std::cerr << "BIG PROBLEMS!!!.. call MUM!" << std::endl; }
}
auto tot_time = std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::system_clock::now()-start).count();
std::cout << "time: " << tot_time << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment