Skip to content

Commit

Permalink
Finally committed the fix for the abysmal C++ reading performance in …
Browse files Browse the repository at this point in the history
…the serialization benchmark.
  • Loading branch information
dnadlinger committed Jul 6, 2011
1 parent 12c92a4 commit e7ab6c3
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/cpp/test/Benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e7ab6c3

Please sign in to comment.