You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know if this is an issue, or if it is expected, but I was surprised at the performance difference between these two loops (2 orders of magnitude), so I thought I'd share:
import time
from intervals import IntInterval
myInterval = IntInterval('[2000,2500]')
start = time.time()
for x in range(0,1000):
if 2222 in myInterval: pass
if x in myInterval: pass
end = time.time()
print end - start
start = time.time()
for x in range(0,1000):
if 2222 >= myInterval.lower and 2222 <= myInterval.upper: pass
if x >= myInterval.lower and t <= myInterval.upper: pass
end = time.time()
print end - start
I have meet the same problem. When i use 'in' operation in a loop, it takes more than 20 mintes to finish the loop, I hope you can impove this performance problem.
Thanks for sharing this. I think most of the overhead comes from decorators and the fact that they coerce compared values to interval objects.
I have met the same problem. When i use 'in' operation in a loop, it takes more than 20 mintes to finish the loop, I hope you can impove this performance problem to makes it better to use.
I don't know if this is an issue, or if it is expected, but I was surprised at the performance difference between these two loops (2 orders of magnitude), so I thought I'd share:
The text was updated successfully, but these errors were encountered: