-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slowness at inverting datetime intervals #20
Comments
Hello, Thank your for raising this issue! The library has not been specifically designed to handle large amounts of intervals, but there is nothing that should prevent it from doing so ;-) So I'll try to investigate where is/are the bottleneck(s) :) Could you please indicate what's the version of Thank you! |
Or, if you cannot share this code (regardless of why ;-)), give some examples of intervals you try to invert. It seems, according to your message, that each interval is composed of hundreds of atomic ones. Is it right? In that case, it is very likely that the forecoming 2.0.0 release will already exhibit some speed-up when computing the complement of such intervals. In 1.x.x, complement of an union (i.e. an |
I've just tested the following snippet with import intervals as I
i = I.Interval(*(I.closed(i, i+1) for i in range(0, 10000, 2)))
assert ~~i == i The last line was So it seems the change I made for |
The version that we have is |
You're welcome ;-) Note that 2.0.0 is not yet released on PyPI. I plan to release it in the next few days, but I still have some things to do before (e.g. I would like to add stub files for type annotations, I would like to write a migration guide from 1.x.x to 2.0.0 and now I would like to check for performance/bottleneck issues ^^). TL;DR: do not consider the master branch of 2.0.0 to be stable at the moment ;-) Also, I'm currently considering changing the name of |
I confirm you shouldn't rely on 2.0.0 for now, I've just found a bug in |
Ok thanks for the info. We'll work around the interval inversion for now until |
I've just released 2.0.0. Notice that Performance-wise, I created a small informal report here : #21 |
Ok, we will do the update and adapt the code. It's still fresh so that should be no problem. |
Hello!
We are using python intervals for our current project, and it's fits very well to our needs. I noticed yesterday that the interval inversion operation is very slow at medium scales. I have compound intervals of datetimes of the scale of hundreds of atomic intervals, and on a reasonably recent computer, the inversion of such intervals takes seconds to complete, which I find strange because I wouldn't say that kind of computation would be that heavy. Here below is some data on the processing time I'm observing. Maybe that reveals some possible optimizations for this operator.
The text was updated successfully, but these errors were encountered: