Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdd038b3

Browse files
committed
Do what the XXX says and use cProfile instead of hotshot. Gets us profiling under PyPy, too.
1 parent65911f2 commitdd038b3

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

‎parse.py‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,16 @@ def parse():
5858
parseMethod=p.parse
5959

6060
ifopts.profile:
61-
#XXX should import cProfile instead and use that
62-
importhotshot
63-
importhotshot.stats
64-
prof=hotshot.Profile('stats.prof')
65-
prof.runcall(parseMethod,f,encoding=encoding)
66-
prof.close()
61+
importcProfile
62+
importpstats
63+
cProfile.runctx("run(parseMethod, f, encoding)",None,
64+
{"run":run,
65+
"parseMethod":parseMethod,
66+
"f":f,
67+
"encoding":encoding},
68+
"stats.prof")
6769
# XXX - We should use a temp file here
68-
stats=hotshot.stats.load('stats.prof')
70+
stats=pstats.Stats('stats.prof')
6971
stats.strip_dirs()
7072
stats.sort_stats('time')
7173
stats.print_stats()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp