[issue35723] Add "time zone index" cache to datetime objects

2019-05-09 Thread STINNER Victor
STINNER Victor added the comment: Paul started a discussion on python-dev: https://mail.python.org/pipermail/python-dev/2019-May/157337.html -- ___ Python tracker ___

[issue35723] Add "time zone index" cache to datetime objects

2019-05-08 Thread Paul Ganssle
Paul Ganssle added the comment: > This sounds like a bug. Whether a tzinfo is a constant from a predefined set > or something with a smart comparison semantic is none of datetime's business. I'm not sure what you mean, but it was not a "bug" in the sense that it was accidental, it was a deli

[issue35723] Add "time zone index" cache to datetime objects

2019-05-07 Thread Ivan Pozdeev
Ivan Pozdeev added the comment: > which unfortunately use `is` to determine whether two datetimes are in the > same zone or not This sounds like a bug. Whether a tzinfo is a constant from a predefined set or something with a smart comparison semantic is none of datetime's business.

[issue35723] Add "time zone index" cache to datetime objects

2019-05-07 Thread Paul Ganssle
Change by Paul Ganssle : -- nosy: +fdrake ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue35723] Add "time zone index" cache to datetime objects

2019-01-14 Thread Paul Ganssle
Paul Ganssle added the comment: > I dislike adding a public API for an optimization. Would it be possible to > make it private? Would it make sense? tzidx => _tzidx. This also would have been my preference, but it is unfortunately not possible because of the way tzinfo works. tzinfo is an ab

[issue35723] Add "time zone index" cache to datetime objects

2019-01-14 Thread STINNER Victor
STINNER Victor added the comment: I dislike adding a public API for an optimization. Would it be possible to make it private? Would it make sense? tzidx => _tzidx. > One other thing I might mention here is that I did explore the idea of > storing this cache on the tzinfo implementation itsel

[issue35723] Add "time zone index" cache to datetime objects

2019-01-11 Thread Eric N. Vander Weele
Change by Eric N. Vander Weele : -- nosy: +ericvw ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue35723] Add "time zone index" cache to datetime objects

2019-01-11 Thread Paul Ganssle
Paul Ganssle added the comment: One other thing I might mention here is that I did explore the idea of storing this cache on the tzinfo implementation itself, but it is problematic for a number of reasons: 1. It would either need to use some sort of expiring cache (lru, ttl) or require a gr

[issue35723] Add "time zone index" cache to datetime objects

2019-01-11 Thread Paul Ganssle
Change by Paul Ganssle : -- keywords: +patch pull_requests: +11122 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-li

[issue35723] Add "time zone index" cache to datetime objects

2019-01-11 Thread Paul Ganssle
New submission from Paul Ganssle : When examining the performance characteristics of pytz, I realized that pytz's eager calculation of tzname, offset and DST gives it an implicit cache that makes it much faster for repeated queries to .utcoffset(), .dst() and/or .tzname() though the eager ca