[issue30080] Add the --duplicate option for timeit

2022-03-16 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30080] Add the --duplicate option for timeit

2017-06-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ah, I even didn't know that "perf timeit" supports -n since it doesn't report 
the number of loops. And seems it runs the benchmark much more times, since 
even with -n1 it is slow. If the number of loops is determined automatically, 
it would do not matter.

I choose the meaning of --duplicate so that it almost not affect the total time 
of the benchmarking. Larger value just decreases the overhead of the iteration.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30080] Add the --duplicate option for timeit

2017-06-07 Thread STINNER Victor

STINNER Victor added the comment:

About the command line interface, I would expect that "timeit -n 10 --duplicate 
10 STMT" would run STMT 100 times. I chose this behaviour in perf timeit:
http://perf.readthedocs.io/en/latest/cli.html#timeit-cmd


Current behaviour chosen by Serhiy, -n3 --duplicate=3 runs STMT 3 times:

$ ./python -m timeit --duplicate=3 -r 1 -n 3 'print("bla")'
bla
bla
bla
3 loops, best of 1: 21.8 usec per loop

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30080] Add the --duplicate option for timeit

2017-05-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30080] Add the --duplicate option for timeit

2017-04-16 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -Guido.van.Rossum, gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30080] Add the --duplicate option for timeit

2017-04-16 Thread Raymond Hettinger

Raymond Hettinger added the comment:

+1 I've long used this technique when timing fast statements.  See 
https://code.activestate.com/recipes/577834 for an example.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30080] Add the --duplicate option for timeit

2017-04-16 Thread Armin Rigo

Changes by Armin Rigo :


--
nosy:  -arigo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30080] Add the --duplicate option for timeit

2017-04-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1290

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30080] Add the --duplicate option for timeit

2017-04-16 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

One of the most used by me option of the "perf timeit" subcommand is 
--duplicate. It duplicates statements to reduce the overhead of the loop. This 
is necessary when measure the time of very fast statements. Proposed patch adds 
this option for CLI of the timeit module.

Similar feature already was proposed in issue21988, but it automatically 
duplicated statements if they executed too fast. This patch does this only on 
explicit request. And it affects only command-line interface. You need to 
duplicate statements manually when use programming interface.

--
components: Demos and Tools, Library (Lib)
messages: 291736
nosy: Guido.van.Rossum, alex, arigo, georg.brandl, gvanrossum, haypo, haypo, 
pitrou, r.david.murray, rhettinger, serhiy.storchaka, steven.daprano, tim.peters
priority: normal
severity: normal
stage: patch review
status: open
title: Add the --duplicate option for timeit
type: enhancement
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com