This commit is contained in:
@@ -148,15 +148,12 @@ def test_motor_val_connect_via_cache():
|
||||
|
||||
def test_speedup_get_pv():
|
||||
"""Ton get_pv délègue à epics.get_pv : on vérifie juste qu'il n'est pas nettement plus lent."""
|
||||
N = 10
|
||||
t0 = time.perf_counter()
|
||||
for _ in range(N):
|
||||
get_pv("TEST:SIM:M13.VAL", connect=False)
|
||||
get_pv("TEST:SIM:M13.VAL", connect=False)
|
||||
t1 = time.perf_counter()
|
||||
|
||||
t2 = time.perf_counter()
|
||||
for _ in range(N):
|
||||
epics.get_pv("TEST:SIM:M13.VAL", connect=True)
|
||||
epics.get_pv("TEST:SIM:M13.VAL", connect=True)
|
||||
t3 = time.perf_counter()
|
||||
|
||||
fast_time = t1 - t0
|
||||
@@ -185,9 +182,9 @@ def test_speedup_motor_instantiation():
|
||||
|
||||
def test_speedup_motor_PV():
|
||||
# baseline EPICS
|
||||
m_epics = epics.Motor("TEST:SIM:M14")
|
||||
m_slow = Motor("TEST:SIM:M14")
|
||||
t0 = time.perf_counter()
|
||||
pv_epics = m_epics.PV("VAL", connect=True, timeout=2.0)
|
||||
pv_slow = m_slow.PV("VAL", connect=True, timeout=2.0)
|
||||
t1 = time.perf_counter()
|
||||
|
||||
m_fast = Motor("TEST:SIM:M15")
|
||||
@@ -195,7 +192,7 @@ def test_speedup_motor_PV():
|
||||
pv_fast = m_fast.PV("VAL", connect=False)
|
||||
t3 = time.perf_counter()
|
||||
|
||||
assert pv_epics.connected
|
||||
assert pv_slow.connected
|
||||
assert not pv_fast.connected
|
||||
|
||||
slow_time = t1 - t0
|
||||
|
||||
Reference in New Issue
Block a user