-
Notifications
You must be signed in to change notification settings - Fork 8
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
the every
operator is highly inefficient
#271
Comments
So the bug is not in the slowdown but in the fact that |
no no it does slow down exponentially which is unexpected. |
OK, but the issue here is not the slowing down. It's the fact that |
For information: I am currently working on a version that has exactly the
same behavior as the current one (i.e. your version) but without the
drawbacks. I hope to commit soon
Le mar. 30 juil. 2024 à 11:27, Alexis Drogoul ***@***.***> a
écrit :
… OK, but the issue here is not the slowing down. It's the fact that every
does not work anymore with irregular intervals (it used to at some point in
time). So replacing it with a version that is accordingly faster (i.e.
because it does not care about the Nth months, as it considers that a month
is 30 days and a year 12 months) *but still buggy* is a strange way to
"solve" it.
—
Reply to this email directly, view it on GitHub
<#271 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALPWHLI7ZB67HCJ7GV2WATZO4I47AVCNFSM6AAAAABLVN4I36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJXGQZTMNBWHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
So what needs to be addressed is the exponential slowing down + the correctness of |
I think there's a problem of definition of the operator to begin with, so we should probably take some time to sit together and properly define what it's supposed to do in what case. |
The behavior should be simple : return true every time we reach the end of a period/interval (like a modulo); and the period/interval can be either regular (1, 1#s, etc.) or irregular (1#month), in which case it should depend on the current date (i.e. 2 months from the 2nd of February of 1969 will not result in the same interval as 2 months from the 2nd of August 1981). |
I commited a solution. I'll let you test.
Le mar. 30 juil. 2024 à 11:46, Baptiste Lesquoy ***@***.***>
a écrit :
… I think there's a problem of definition of the operator to begin with, so
we should probably take some time to sit together and properly define what
it's supposed to do in what case.
Because there are multiple ways that could make sense depending on what we
want this operator to be used for
—
Reply to this email directly, view it on GitHub
<#271 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALPWHKUD27SENEZPY6FL2LZO4LA7AVCNFSM6AAAAABLVN4I36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJXGQ2TEMRXGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
every
operator is highly ineffectiveevery
operator is highly inefficient
Describe the bug
While trying to understand why a model was getting slower and slower over time I realized that after running it for one hour, most of the computing time was spent in the
every
operator. Looking at the code it makes sense as it seem to increment a duration in a loop until it reaches current date, so the farthest away the current date the longer it takes.Additionally I didn't find any use for that kind of incremental code as the operator is not taking into account the particularities of incrementing one month (which could have a different number of days)
as can be demonstrated by this model:
which yields this result:
Expected behavior
every
shouldn't slow down the modelThe text was updated successfully, but these errors were encountered: