Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
a4dac409
Kaydet (Commit)
a4dac409
authored
Mar 03, 2005
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #645894: Use getrusage for computing the time consumption in
profile.py if available.
üst
7fe60c0a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
profile.py
Lib/profile.py
+20
-2
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/profile.py
Dosyayı görüntüle @
a4dac409
...
@@ -107,6 +107,20 @@ if hasattr(os, "times"):
...
@@ -107,6 +107,20 @@ if hasattr(os, "times"):
t
=
timer
()
t
=
timer
()
return
t
[
0
]
+
t
[
1
]
return
t
[
0
]
+
t
[
1
]
# Using getrusage(3) is better than clock(3) if available:
# on some systems (e.g. FreeBSD), getrusage has a higher resolution
# Furthermore, on a POSIX system, returns microseconds, which
# wrap around after 36min.
_has_res
=
0
try
:
import
resource
resgetrusage
=
lambda
:
resource
.
getrusage
(
resource
.
RUSAGE_SELF
)
def
_get_time_resource
(
timer
=
resgetrusage
):
t
=
timer
()
return
t
[
0
]
+
t
[
1
]
_has_res
=
1
except
ImportError
:
pass
class
Profile
:
class
Profile
:
"""Profiler class.
"""Profiler class.
...
@@ -159,8 +173,12 @@ class Profile:
...
@@ -159,8 +173,12 @@ class Profile:
bias
=
self
.
bias
bias
=
self
.
bias
self
.
bias
=
bias
# Materialize in local dict for lookup speed.
self
.
bias
=
bias
# Materialize in local dict for lookup speed.
if
timer
is
None
:
if
not
timer
:
if
os
.
name
==
'mac'
:
if
_has_res
:
self
.
timer
=
resgetrusage
self
.
dispatcher
=
self
.
trace_dispatch
self
.
get_time
=
_get_time_resource
elif
os
.
name
==
'mac'
:
self
.
timer
=
MacOS
.
GetTicks
self
.
timer
=
MacOS
.
GetTicks
self
.
dispatcher
=
self
.
trace_dispatch_mac
self
.
dispatcher
=
self
.
trace_dispatch_mac
self
.
get_time
=
_get_time_mac
self
.
get_time
=
_get_time_mac
...
...
Misc/NEWS
Dosyayı görüntüle @
a4dac409
...
@@ -64,6 +64,9 @@ Extension Modules
...
@@ -64,6 +64,9 @@ Extension Modules
Library
Library
-------
-------
- Patch #645894: Use getrusage for computing the time consumption in
profile.py if available.
- Patch #1046831: Use get_python_version where appropriate in sysconfig.py.
- Patch #1046831: Use get_python_version where appropriate in sysconfig.py.
- Patch #1117454: Remove code to special-case cookies without values
- Patch #1117454: Remove code to special-case cookies without values
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment