| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Are the benchmarks realised on a PGO build or a debug build? or maybe PGO+LTO? or just release build? |
Sorry, something went wrong.
|
Both are just plain builds. python3.14 is from the morning but I doubt the few commits matter. |
Sorry, something went wrong.
|
By plain builds, do you mean with or withou --with-pydebug? I assume without so it's probably release builds so it should be fine. But please the configure flags |
Sorry, something went wrong.
|
@pganssle can you take a look at this? |
Sorry, something went wrong.
There was a problem hiding this comment.
On my part, it looks good but I'll let a datetime expert have the final decision.
Sorry, something went wrong.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
Friendly ping @pganssle Any comments on this? |
Sorry, something went wrong.
There was a problem hiding this comment.
This is an acceptable way to do it, but IIRC we already pushed some of this kind of dispatching logic in new_date_subclass_ex, so I think you can replace the entire contents of date_today with this:
static PyObject *
date_today(PyObject *cls, PyObject *Py_UNUSED(dummy))
{
/* Use C implementation to boost performance for date type */
struct tm tm;
time_t t;
time(&t);
if (_PyTime_localtime(t, &tm) != 0) {
return NULL;
}
return new_date_subclass_ex(tm.tm_year + 1900,
tm.tm_mon + 1,
tm.tm_mday,
(PyObject *)cls);
}And you'll get the same speedup and as a bonus datetime.today() will also get the same speedup.
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request. |
Sorry, something went wrong.
# Conflicts: # Modules/_datetimemodule.c
It will be incorrect though? Since datetime.today has hours, minutes etc. |
Sorry, something went wrong.
Hah, oops, right, right. Should have run the test suite and not just the benchmark. OK, let's go with this as it is and if we want to speed up datetime.today we can add an implementation for datetime.datetime that is just effectively return datetime.now(tz=None). |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Other suggested implementations are not as backward compatible.
~5x faster for date types