Message395116
Yeah, I knew this was slower and it's been on my long list to look at it (tied to this is the fact that `datetime.today()` is basically just a slow version of `datetime.now()`, in defiance of user expectations).
My inclination is that we shouldn't re-implement `fromtimestamp` in `date.today`, but rather call `date_fromtimestamp` in the fast path. I believe that incurs the overhead of creating one additional Python object (an integer), but if it's a sufficiently significant speedup, we could possibly refactor `date_fromtimestamp` to a version that accepts a C integer and a version that accepts a Python integer, then call the version accepting a C integer.
I think this won't give any speedup to `datetime.today`, since `datetime.today` will still take the slow path. If we care about this, we *may* be able to implement `datetime.today` as an alias for `datetime.now(None)`, assuming there are no behavioral differences between the two. |
|
Date |
User |
Action |
Args |
2021-06-04 19:55:33 | p-ganssle | set | recipients:
+ p-ganssle, Anthony Sottile, corona10, rkm |
2021-06-04 19:55:33 | p-ganssle | set | messageid: <1622836533.53.0.011664803928.issue44307@roundup.psfhosted.org> |
2021-06-04 19:55:33 | p-ganssle | link | issue44307 messages |
2021-06-04 19:55:33 | p-ganssle | create | |
|