from __future__ import print_function
import time, sys
import Pyro4

if sys.version_info<(3,0):
    input=raw_input

uri=input("Uri of benchmark server? ").strip()

print("Timing raw connect speed (no method call)...")
p=Pyro4.core.Proxy(uri)
p.ping()
ITERATIONS=2000
begin=time.time()
for loop in range(ITERATIONS):
    if loop%500==0:
        print(loop)
    p._pyroRelease()
    p._pyroBind()
duration=time.time()-begin
print("%d connections in %.3f sec = %.0f conn/sec" % (ITERATIONS, duration, ITERATIONS/duration))
del p

print("Timing proxy creation+connect+methodcall speed...")
ITERATIONS=2000
begin=time.time()
for loop in range(ITERATIONS):
    if loop%500==0:
        print(loop)
    with Pyro4.core.Proxy(uri) as p:
        p.ping()
duration=time.time()-begin
print("%d new proxy calls in %.3f sec = %.0f calls/sec" % (ITERATIONS, duration, ITERATIONS/duration))

print("Timing proxy methodcall speed...")
p=Pyro4.core.Proxy(uri)
p.ping()
ITERATIONS=10000
begin=time.time()
for loop in range(ITERATIONS):
    if loop%1000==0:
        print(loop)
    p.ping()
duration=time.time()-begin
print("%d calls in %.3f sec = %.0f calls/sec" % (ITERATIONS, duration, ITERATIONS/duration))

4e491c4b003a50983f8b9fb90f54c0184ddc54a7
<mask token>

<mask token>
if sys.version_info < (3, 0):
    input = raw_input
<mask token>
print('Timing raw connect speed (no method call)...')
<mask token>
p.ping()
<mask token>
for loop in range(ITERATIONS):
    if loop % 500 == 0:
        print(loop)
    p._pyroRelease()
    p._pyroBind()
<mask token>
print('%d connections in %.3f sec = %.0f conn/sec' % (ITERATIONS, duration,
    ITERATIONS / duration))
del p
print('Timing proxy creation+connect+methodcall speed...')
<mask token>
for loop in range(ITERATIONS):
    if loop % 500 == 0:
        print(loop)
    with Pyro4.core.Proxy(uri) as p:
        p.ping()
<mask token>
print('%d new proxy calls in %.3f sec = %.0f calls/sec' % (ITERATIONS,
    duration, ITERATIONS / duration))
print('Timing proxy methodcall speed...')
<mask token>
p.ping()
<mask token>
for loop in range(ITERATIONS):
    if loop % 1000 == 0:
        print(loop)
    p.ping()
<mask token>
print('%d calls in %.3f sec = %.0f calls/sec' % (ITERATIONS, duration, 
    ITERATIONS / duration))

<mask token>
if sys.version_info < (3, 0):
    input = raw_input
uri = input('Uri of benchmark server? ').strip()
print('Timing raw connect speed (no method call)...')
p = Pyro4.core.Proxy(uri)
p.ping()
ITERATIONS = 2000
begin = time.time()
for loop in range(ITERATIONS):
    if loop % 500 == 0:
        print(loop)
    p._pyroRelease()
    p._pyroBind()
duration = time.time() - begin
print('%d connections in %.3f sec = %.0f conn/sec' % (ITERATIONS, duration,
    ITERATIONS / duration))
del p
print('Timing proxy creation+connect+methodcall speed...')
ITERATIONS = 2000
begin = time.time()
for loop in range(ITERATIONS):
    if loop % 500 == 0:
        print(loop)
    with Pyro4.core.Proxy(uri) as p:
        p.ping()
duration = time.time() - begin
print('%d new proxy calls in %.3f sec = %.0f calls/sec' % (ITERATIONS,
    duration, ITERATIONS / duration))
print('Timing proxy methodcall speed...')
p = Pyro4.core.Proxy(uri)
p.ping()
ITERATIONS = 10000
begin = time.time()
for loop in range(ITERATIONS):
    if loop % 1000 == 0:
        print(loop)
    p.ping()
duration = time.time() - begin
print('%d calls in %.3f sec = %.0f calls/sec' % (ITERATIONS, duration, 
    ITERATIONS / duration))

from __future__ import print_function
import time, sys
import Pyro4
if sys.version_info < (3, 0):
    input = raw_input
uri = input('Uri of benchmark server? ').strip()
print('Timing raw connect speed (no method call)...')
p = Pyro4.core.Proxy(uri)
p.ping()
ITERATIONS = 2000
begin = time.time()
for loop in range(ITERATIONS):
    if loop % 500 == 0:
        print(loop)
    p._pyroRelease()
    p._pyroBind()
duration = time.time() - begin
print('%d connections in %.3f sec = %.0f conn/sec' % (ITERATIONS, duration,
    ITERATIONS / duration))
del p
print('Timing proxy creation+connect+methodcall speed...')
ITERATIONS = 2000
begin = time.time()
for loop in range(ITERATIONS):
    if loop % 500 == 0:
        print(loop)
    with Pyro4.core.Proxy(uri) as p:
        p.ping()
duration = time.time() - begin
print('%d new proxy calls in %.3f sec = %.0f calls/sec' % (ITERATIONS,
    duration, ITERATIONS / duration))
print('Timing proxy methodcall speed...')
p = Pyro4.core.Proxy(uri)
p.ping()
ITERATIONS = 10000
begin = time.time()
for loop in range(ITERATIONS):
    if loop % 1000 == 0:
        print(loop)
    p.ping()
duration = time.time() - begin
print('%d calls in %.3f sec = %.0f calls/sec' % (ITERATIONS, duration, 
    ITERATIONS / duration))

from __future__ import print_function
import time, sys
import Pyro4

if sys.version_info<(3,0):
    input=raw_input

uri=input("Uri of benchmark server? ").strip()

print("Timing raw connect speed (no method call)...")
p=Pyro4.core.Proxy(uri)
p.ping()
ITERATIONS=2000
begin=time.time()
for loop in range(ITERATIONS):
    if loop%500==0:
        print(loop)
    p._pyroRelease()
    p._pyroBind()
duration=time.time()-begin
print("%d connections in %.3f sec = %.0f conn/sec" % (ITERATIONS, duration, ITERATIONS/duration))
del p

print("Timing proxy creation+connect+methodcall speed...")
ITERATIONS=2000
begin=time.time()
for loop in range(ITERATIONS):
    if loop%500==0:
        print(loop)
    with Pyro4.core.Proxy(uri) as p:
        p.ping()
duration=time.time()-begin
print("%d new proxy calls in %.3f sec = %.0f calls/sec" % (ITERATIONS, duration, ITERATIONS/duration))

print("Timing proxy methodcall speed...")
p=Pyro4.core.Proxy(uri)
p.ping()
ITERATIONS=10000
begin=time.time()
for loop in range(ITERATIONS):
    if loop%1000==0:
        print(loop)
    p.ping()
duration=time.time()-begin
print("%d calls in %.3f sec = %.0f calls/sec" % (ITERATIONS, duration, ITERATIONS/duration))
