summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/throughput/ThroughputI.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2006-12-05 16:46:33 +0000
committerDwayne Boone <dwayne@zeroc.com>2006-12-05 16:46:33 +0000
commit5fde960286c966f7293d1817c4e2eedf0cfd5250 (patch)
tree71bbec5577d3ef4fad7fa1b7f0c6cf16546bab1f /cpp/demo/Ice/throughput/ThroughputI.cpp
parentAdded warmup to Java throughput demo (diff)
downloadice-5fde960286c966f7293d1817c4e2eedf0cfd5250.tar.bz2
ice-5fde960286c966f7293d1817c4e2eedf0cfd5250.tar.xz
ice-5fde960286c966f7293d1817c4e2eedf0cfd5250.zip
Added warmup to java throughout demo
Diffstat (limited to 'cpp/demo/Ice/throughput/ThroughputI.cpp')
-rw-r--r--cpp/demo/Ice/throughput/ThroughputI.cpp45
1 files changed, 40 insertions, 5 deletions
diff --git a/cpp/demo/Ice/throughput/ThroughputI.cpp b/cpp/demo/Ice/throughput/ThroughputI.cpp
index b769c6c54de..8d0fe46e322 100644
--- a/cpp/demo/Ice/throughput/ThroughputI.cpp
+++ b/cpp/demo/Ice/throughput/ThroughputI.cpp
@@ -14,7 +14,8 @@ ThroughputI::ThroughputI() :
_byteSeq(Demo::ByteSeqSize),
_stringSeq(Demo::StringSeqSize, "hello"),
_structSeq(Demo::StringDoubleSeqSize),
- _fixedSeq(Demo::FixedSeqSize)
+ _fixedSeq(Demo::FixedSeqSize),
+ _warmup(true)
{
int i;
for(i = 0; i < Demo::StringDoubleSeqSize; ++i)
@@ -31,6 +32,12 @@ ThroughputI::ThroughputI() :
}
void
+ThroughputI::endWarmup(const Ice::Current&)
+{
+ _warmup = false;
+}
+
+void
ThroughputI::sendByteSeq(const std::pair<const Ice::Byte*, const Ice::Byte*>&, const Ice::Current&)
{
}
@@ -38,7 +45,14 @@ ThroughputI::sendByteSeq(const std::pair<const Ice::Byte*, const Ice::Byte*>&, c
Demo::ByteSeq
ThroughputI::recvByteSeq(const Ice::Current&)
{
- return _byteSeq;
+ if(_warmup)
+ {
+ return Demo::ByteSeq();
+ }
+ else
+ {
+ return _byteSeq;
+ }
}
Demo::ByteSeq
@@ -55,7 +69,14 @@ ThroughputI::sendStringSeq(const Demo::StringSeq&, const Ice::Current&)
Demo::StringSeq
ThroughputI::recvStringSeq(const Ice::Current&)
{
- return _stringSeq;
+ if(_warmup)
+ {
+ return Demo::StringSeq();
+ }
+ else
+ {
+ return _stringSeq;
+ }
}
Demo::StringSeq
@@ -72,7 +93,14 @@ ThroughputI::sendStructSeq(const Demo::StringDoubleSeq&, const Ice::Current&)
Demo::StringDoubleSeq
ThroughputI::recvStructSeq(const Ice::Current&)
{
- return _structSeq;
+ if(_warmup)
+ {
+ return Demo::StringDoubleSeq();
+ }
+ else
+ {
+ return _structSeq;
+ }
}
Demo::StringDoubleSeq
@@ -89,7 +117,14 @@ ThroughputI::sendFixedSeq(const Demo::FixedSeq&, const Ice::Current&)
Demo::FixedSeq
ThroughputI::recvFixedSeq(const Ice::Current&)
{
- return _fixedSeq;
+ if(_warmup)
+ {
+ return Demo::FixedSeq();
+ }
+ else
+ {
+ return _fixedSeq;
+ }
}
Demo::FixedSeq