PEP 418: Add link to benchmarking programs used to fill tables
This commit is contained in:
parent
636c74aeca
commit
e1d068556d
32
pep-0418.txt
32
pep-0418.txt
|
@ -800,7 +800,9 @@ Performance
|
|||
|
||||
Reading an hardware clock has a cost. The following table compares
|
||||
the performance of different hardware clocks on Linux 3.3 with Intel
|
||||
Core i7-2600 at 3.40GHz (8 cores).
|
||||
Core i7-2600 at 3.40GHz (8 cores). The `bench_time.c
|
||||
<http://hg.python.org/peps/file/tip/pep-0418/bench_time.c>`_ program
|
||||
was used to fill these tables.
|
||||
|
||||
======================== ====== ======= ======
|
||||
Function TSC ACPI PM HPET
|
||||
|
@ -817,10 +819,6 @@ CLOCK_REALTIME 27 ns 707 ns 629 ns
|
|||
CLOCK_MONOTONIC 27 ns 723 ns 635 ns
|
||||
======================== ====== ======= ======
|
||||
|
||||
Each function was called 10,000,000 times and CLOCK_MONOTONIC was used
|
||||
to get the time before and after. The benchmark was run 5 times to
|
||||
keep the minimum time.
|
||||
|
||||
FreeBSD 8.0 in kvm with hardware virtualization:
|
||||
|
||||
======================== ====== ========= ======= =======
|
||||
|
@ -918,6 +916,11 @@ CLOCK_MONOTONIC_COARSE Linux 3.0 4 ms 4 ms
|
|||
GetTickCount64() Windows Seven 16 ms 15 ms
|
||||
========================= ================ ========= ===================
|
||||
|
||||
The "Precision in Python" column was filled using the
|
||||
`clock_precision.py
|
||||
<http://hg.python.org/peps/file/tip/pep-0418/clock_precision.py>`_
|
||||
program.
|
||||
|
||||
mach_absolute_time
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
@ -1165,6 +1168,11 @@ GetSystemTimeAsFileTime() Windows Seven 16 ms 1 ms
|
|||
ftime() Windows Seven \- 1 ms
|
||||
========================= ================ ========= ===================
|
||||
|
||||
The "Precision in Python" column was filled using the
|
||||
`clock_precision.py
|
||||
<http://hg.python.org/peps/file/tip/pep-0418/clock_precision.py>`_
|
||||
program.
|
||||
|
||||
|
||||
Windows: GetSystemTimeAsFileTime
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@ -1240,6 +1248,11 @@ GetProcessTimes() Windows Seven 16 ms 16 ms
|
|||
clock() Windows Seven 1 ms 1 ms
|
||||
========================= ================ ========= ===================
|
||||
|
||||
The "Precision in Python" column was filled using the
|
||||
`clock_precision.py
|
||||
<http://hg.python.org/peps/file/tip/pep-0418/clock_precision.py>`_
|
||||
program.
|
||||
|
||||
Functions
|
||||
^^^^^^^^^
|
||||
|
||||
|
@ -1294,8 +1307,10 @@ CLOCK_THREAD_CPUTIME_ID Linux 3.3 1 ns 649 n
|
|||
GetThreadTimes() Windows Seven 16 ms 16 ms
|
||||
========================= ================ =============== ===================
|
||||
|
||||
CLOCK_THREAD_CPUTIME_ID returns a number of CPU cycles, not a number of
|
||||
seconds.
|
||||
The "Precision in Python" column was filled using the
|
||||
`clock_precision.py
|
||||
<http://hg.python.org/peps/file/tip/pep-0418/clock_precision.py>`_
|
||||
program.
|
||||
|
||||
|
||||
Functions
|
||||
|
@ -1305,7 +1320,8 @@ Functions
|
|||
<http://msdn.microsoft.com/en-us/library/windows/desktop/ms683237(v=vs.85).aspx>`_.
|
||||
The precision can be read using GetSystemTimeAdjustment().
|
||||
* clock_gettime(CLOCK_THREAD_CPUTIME_ID): Thread-specific CPU-time
|
||||
clock. The precision can be read using of clock_getres().
|
||||
clock. It uses a number of CPU cycles, not a number of seconds.
|
||||
The precision can be read using of clock_getres().
|
||||
|
||||
See also the `QueryThreadCycleTime() function
|
||||
<http://msdn.microsoft.com/en-us/library/windows/desktop/ms684943(v=vs.85).aspx>`_
|
||||
|
|
Loading…
Reference in New Issue