This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: gcmodule.c could use pytime.h
Type: enhancement Stage: resolved
Components: Extension Modules, Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: geoffreyspear, maciej.szulik, nikratio, pitrou, python-dev, sunfinite
Priority: low Keywords: easy, patch

Created on 2014-05-22 19:06 by pitrou, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue21555.patch geoffreyspear, 2014-05-23 13:21 patch to use pytime.h review
issue21555-2.patch geoffreyspear, 2014-05-23 13:47 patch to remove use of time module review
issue21555-3.patch geoffreyspear, 2014-05-24 15:30 review
Messages (6)
msg218912 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-05-22 19:06
gcmodule.c is able to displayed elapsed time of garbage collection runs. It currently does it by poking inside the time module to call time.time() and convert it to a C double. It could instead use the new pytime.h facilities.
msg218969 - (view) Author: Geoffrey Spear (geoffreyspear) * Date: 2014-05-23 13:21
Attached patch replaces call to Python time.time() with _PyTime_gettimeofday() call.
msg218972 - (view) Author: Geoffrey Spear (geoffreyspear) * Date: 2014-05-23 13:47
revised patch; thanks to berkerpeksag's code review.
msg219047 - (view) Author: Geoffrey Spear (geoffreyspear) * Date: 2014-05-24 15:30
Per pitrou's suggestion, eliminate get_time altogether and use _PyTime_INTERVAL macro.
msg219049 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-05-24 17:22
New changeset d151ee749f5a by Antoine Pitrou in branch 'default':
Issue #21555: simplify code in gcmodule.c by using the pytime.h functions instead of trying to call time.time() via the C API.
http://hg.python.org/cpython/rev/d151ee749f5a
msg219050 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-05-24 17:25
Patch committed. Thank you for contributing, Geoffrey!
History
Date User Action Args
2022-04-11 14:58:03adminsetgithub: 65754
2014-05-24 17:25:58pitrousetstatus: open -> closed
resolution: fixed
messages: + msg219050

stage: needs patch -> resolved
2014-05-24 17:22:03python-devsetnosy: + python-dev
messages: + msg219049
2014-05-24 15:30:10geoffreyspearsetfiles: + issue21555-3.patch

messages: + msg219047
2014-05-23 13:47:40geoffreyspearsetfiles: + issue21555-2.patch

messages: + msg218972
2014-05-23 13:21:05geoffreyspearsetfiles: + issue21555.patch
keywords: + patch
messages: + msg218969
2014-05-23 12:26:21geoffreyspearsetnosy: + geoffreyspear
2014-05-22 23:11:50nikratiosetnosy: + nikratio
2014-05-22 20:57:06maciej.szuliksetnosy: + maciej.szulik
2014-05-22 19:31:14sunfinitesetnosy: + sunfinite
2014-05-22 19:06:06pitroucreate