Permalink
Browse files

Finally committed the fix for the abysmal C++ reading performance in …

…the serialization benchmark.
  • Loading branch information...
klickverbot committed Jul 6, 2011
1 parent 12c92a4 commit e7ab6c3b14b31c0241a1d37e674d3fefcbb53276
Showing with 4 additions and 7 deletions.
  1. +4 −7 lib/cpp/test/Benchmark.cpp
View
@@ -86,17 +86,14 @@ int main() {
buf->getBuffer(&data, &datasize);
{
-
Timer timer;
+ OneOfEach ooe2;
+ shared_ptr<TMemoryBuffer> buf2(new TMemoryBuffer(data, datasize));
+ TBinaryProtocolT<TBufferBase> prot(buf2);
for (int i = 0; i < num; i ++) {
- OneOfEach ooe2;
- shared_ptr<TMemoryBuffer> buf2(new TMemoryBuffer(data, datasize));
- //buf2->resetBuffer(data, datasize);
- TBinaryProtocolT<TBufferBase> prot(buf2);
+ buf2->resetBuffer(data, datasize);
ooe2.read(&prot);
-
- //cout << apache::thrift::ThriftDebugString(ooe2) << endl << endl;
}
cout << " Read: " << num / (1000 * timer.frame()) << " kHz" << endl;
}

0 comments on commit e7ab6c3

Please sign in to comment.