msg197322 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-09-08 21:15 |
Just an idea. Currently the timeit module in command line automatically choice most appropriate time unit for human readable output. But this makes the output less machine readable. I propose to add new option which specifies fixed time unit (usec, msec, sec).
|
msg197333 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2013-09-08 22:36 |
If you want the output to be machine readable, better go the full way and add a --json option, IMO.
|
msg197345 - (view) |
Author: Jakub Stasiak (jstasiak) * |
Date: 2013-09-09 01:11 |
My 2 cents - I'd split timeit.main function into processing part and argument parsing + data printing part so that you could use Python to call the first one to get the actual results (timings, numbers of loops etc.) and then present the data to the outside world in any needed format - no text parsing needed.
|
msg204541 - (view) |
Author: Julian Gindi (Julian.Gindi) * |
Date: 2013-11-26 22:33 |
I created a patch that allows users to specify a time unit output using the "-u" flag. Example usage:
python -m timeit -u "msec" '"-".join(str(n) for n in range(100))'
>> 10000 loops, best of 3: 0.156 msec per loop
python -m timeit -u "sec" '"-".join(str(n) for n in range(100))'
>> 10000 loops, best of 3: 0.000159 sec per loop
You can specify msec, sec, or usec. I am also interested in having a JSON option as mentioned by Antoine. Any thoughts?
|
msg204606 - (view) |
Author: Julian Gindi (Julian.Gindi) * |
Date: 2013-11-27 18:03 |
Updated patch to include unit tests.
|
msg205612 - (view) |
Author: Julian Gindi (Julian.Gindi) * |
Date: 2013-12-08 22:13 |
Just wanted to check to see if there was anything else I should do regarding this issue.
|
msg205697 - (view) |
Author: Julian Gindi (Julian.Gindi) * |
Date: 2013-12-09 14:40 |
Implemented proposed changes to patch. Simplified "for-loop" and implemented invalid input test.
|
msg205720 - (view) |
Author: Julian Gindi (Julian.Gindi) * |
Date: 2013-12-09 17:58 |
Incorporated updates suggested by serhiy.storchaka
|
msg205723 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-12-09 18:21 |
It will be better to write error message to sys.stderr (see test_main_exception).
|
msg205731 - (view) |
Author: Julian Gindi (Julian.Gindi) * |
Date: 2013-12-09 19:28 |
Updated patch to log to stderr.
|
msg205736 - (view) |
Author: Julian Gindi (Julian.Gindi) * |
Date: 2013-12-09 19:54 |
Added newline after error message.
|
msg205737 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-12-09 20:12 |
The patch is doubled.
|
msg205738 - (view) |
Author: Julian Gindi (Julian.Gindi) * |
Date: 2013-12-09 20:14 |
Whoops. Sorry about that. Super embarrassing.
|
msg205914 - (view) |
Author: Julian Gindi (Julian.Gindi) * |
Date: 2013-12-11 18:57 |
Re-uploaded the patch to remove duplication.
|
msg205922 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-12-11 20:28 |
Besides too long line with sys.stderr.write last patch LGTM.
|
msg205923 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-12-11 20:29 |
Ah, I forgot. This feature should be documented in Doc/library/timeit.rst.
|
msg205931 - (view) |
Author: Julian Gindi (Julian.Gindi) * |
Date: 2013-12-11 21:56 |
Updated documentation and fixed a few lines that were too long.
|
msg206834 - (view) |
Author: Julian Gindi (Julian.Gindi) * |
Date: 2013-12-22 22:26 |
Just wanted to check in and see if the documentation change I made is sufficient. I tried to copy the other entries for the command line arguments. Let me know if I can improve it in any way.
|
msg206869 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-12-23 17:04 |
LGTM.
|
msg207990 - (view) |
Author: Julian Gindi (Julian.Gindi) * |
Date: 2014-01-13 01:01 |
What needs to be done to close this one out?
|
msg207995 - (view) |
Author: Vajrasky Kok (vajrasky) * |
Date: 2014-01-13 01:41 |
This feature is for Python 3.5. I think, we will not commit anything to Python 3.5 until Python 3.4 branch is created (in other world, released). So, be patient. :)
|
msg216024 - (view) |
Author: Quentin Pradet (Quentin.Pradet) * |
Date: 2014-04-13 16:08 |
The branch appears to exist now.
|
msg226093 - (view) |
Author: Julian Gindi (Julian.Gindi) * |
Date: 2014-08-29 22:26 |
Anything else need to be done on this patch?
|
msg233346 - (view) |
Author: Vincent Davis (Vincentdavis) |
Date: 2015-01-03 04:16 |
Anything else need to be done on this patch?
|
msg233348 - (view) |
Author: Berker Peksag (berker.peksag) *  |
Date: 2015-01-03 04:35 |
I've added a couple of comments on Rietveld.
|
msg238337 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2015-03-17 20:55 |
New changeset 1ebf8d5b7d60 by Robert Collins in branch 'default':
Issue #18983: Allow selection of output units in timeit.
https://hg.python.org/cpython/rev/1ebf8d5b7d60
|
msg238338 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2015-03-17 20:59 |
New changeset ed34dd00405e by Robert Collins in branch 'default':
Fix patch attribution for issue 18983.
https://hg.python.org/cpython/rev/ed34dd00405e
|
|
Date |
User |
Action |
Args |
2022-04-11 14:57:50 | admin | set | github: 63183 |
2015-03-17 21:01:41 | rbcollins | set | status: open -> closed nosy:
+ rbcollins
resolution: fixed stage: patch review -> resolved |
2015-03-17 20:59:45 | python-dev | set | messages:
+ msg238338 |
2015-03-17 20:55:09 | python-dev | set | nosy:
+ python-dev messages:
+ msg238337
|
2015-01-03 04:35:20 | berker.peksag | set | nosy:
+ berker.peksag messages:
+ msg233348
|
2015-01-03 04:16:42 | Vincentdavis | set | nosy:
+ Vincentdavis messages:
+ msg233346
|
2014-08-29 22:26:55 | Julian.Gindi | set | messages:
+ msg226093 |
2014-04-13 16:08:58 | Quentin.Pradet | set | nosy:
+ Quentin.Pradet messages:
+ msg216024
|
2014-01-13 01:41:22 | vajrasky | set | nosy:
+ vajrasky messages:
+ msg207995
|
2014-01-13 01:01:56 | Julian.Gindi | set | messages:
+ msg207990 |
2013-12-23 17:04:49 | serhiy.storchaka | set | messages:
+ msg206869 |
2013-12-22 22:26:14 | Julian.Gindi | set | messages:
+ msg206834 |
2013-12-11 21:56:36 | Julian.Gindi | set | files:
+ issue18983_v6.patch
messages:
+ msg205931 |
2013-12-11 20:29:34 | serhiy.storchaka | set | messages:
+ msg205923 |
2013-12-11 20:28:05 | serhiy.storchaka | set | messages:
+ msg205922 |
2013-12-11 18:57:12 | Julian.Gindi | set | messages:
+ msg205914 |
2013-12-09 20:14:26 | Julian.Gindi | set | files:
+ issue18983_v5.patch
messages:
+ msg205738 |
2013-12-09 20:12:52 | serhiy.storchaka | set | messages:
+ msg205737 |
2013-12-09 19:54:37 | Julian.Gindi | set | files:
+ issue18983_v5.patch
messages:
+ msg205736 |
2013-12-09 19:28:47 | Julian.Gindi | set | files:
+ issue18983_v4.patch
messages:
+ msg205731 |
2013-12-09 18:21:53 | serhiy.storchaka | set | messages:
+ msg205723 |
2013-12-09 17:58:29 | Julian.Gindi | set | files:
+ issue18983_v3.patch
messages:
+ msg205720 |
2013-12-09 14:40:48 | Julian.Gindi | set | files:
+ issue18983_v2.patch
messages:
+ msg205697 |
2013-12-08 22:14:19 | ezio.melotti | set | nosy:
+ ezio.melotti stage: needs patch -> patch review
versions:
+ Python 3.5, - Python 3.4 |
2013-12-08 22:13:05 | Julian.Gindi | set | messages:
+ msg205612 |
2013-11-27 18:03:21 | Julian.Gindi | set | files:
+ issue18983.patch
messages:
+ msg204606 |
2013-11-26 22:33:40 | Julian.Gindi | set | files:
+ issue18983.patch
nosy:
+ Julian.Gindi messages:
+ msg204541
keywords:
+ patch |
2013-09-09 01:11:05 | jstasiak | set | nosy:
+ jstasiak messages:
+ msg197345
|
2013-09-08 22:36:32 | pitrou | set | nosy:
+ pitrou, tim.peters messages:
+ msg197333
|
2013-09-08 21:15:56 | serhiy.storchaka | create | |