diff options
author | Matthew Newhook <matthew@zeroc.com> | 2007-06-11 15:59:31 +0800 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2007-06-11 15:59:31 +0800 |
commit | cec251ca44005882f610ba110b6886dc2112761b (patch) | |
tree | 121f94ad141c71838f92e0745819847e31a13eb5 /py/demo/Ice/throughput/Client.py | |
parent | Merged Bernards change for http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id... (diff) | |
download | ice-cec251ca44005882f610ba110b6886dc2112761b.tar.bz2 ice-cec251ca44005882f610ba110b6886dc2112761b.tar.xz ice-cec251ca44005882f610ba110b6886dc2112761b.zip |
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=2039
Diffstat (limited to 'py/demo/Ice/throughput/Client.py')
-rw-r--r-- | py/demo/Ice/throughput/Client.py | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/py/demo/Ice/throughput/Client.py b/py/demo/Ice/throughput/Client.py index 2951830deaa..6466304e129 100644 --- a/py/demo/Ice/throughput/Client.py +++ b/py/demo/Ice/throughput/Client.py @@ -67,9 +67,46 @@ class Client(Ice.Application): fixedSeq[i].j = 0 fixedSeq[i].d = 0.0 - menu() + # + # To allow cross-language tests we may need to "warm up" the + # server. The warm up is to ensure that any JIT compiler will + # have converted any hotspots to native code. This ensures an + # accurate throughput measurement. + # + if throughput.needsWarmup(): + throughput.startWarmup() + + emptyBytes = [ '\x00' ] + emptyBytes = ''.join(emptyBytes) + emptyStrings = [ "" ] + emptyStructs = [ Demo.StringDouble() ] + emptyFixed = [ Demo.Fixed() ] + + print "warming up the server...", + sys.stdout.flush() + for i in range(0, 10000): + throughput.sendByteSeq(emptyBytes) + throughput.sendStringSeq(emptyStrings) + throughput.sendStructSeq(emptyStructs) + throughput.sendFixedSeq(emptyFixed) + + throughput.recvByteSeq() + throughput.recvStringSeq() + throughput.recvStructSeq() + throughput.recvFixedSeq() + + throughput.echoByteSeq(emptyBytes) + throughput.echoStringSeq(emptyStrings) + throughput.echoStructSeq(emptyStructs) + throughput.echoFixedSeq(emptyFixed) + + throughput.endWarmup() + + print "ok" + else: + throughput.ice_ping() # Initial ping to setup the connection. - throughput.endWarmup() # Initial ping to setup the connection. + menu() currentType = '1' seqSize = Demo.ByteSeqSize |