-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make hooks work in bench_command subprocesses #197
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to understand the detail :)
Please give me enough time by this week. (well 2-3 days will take when considering timezone issue)
|
||
if devnull is not None: | ||
devnull.close() | ||
|
||
for hook in hook_managers.values(): | ||
hook.teardown(metadata) | ||
|
||
# Write timing in seconds into stdout | ||
print(dt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdboom Would you like to extract printing data logic into a single function and then add a comment about the function from the parsing metadata logic at bench_command to explain why we parse that way?
try: | ||
lines = output.splitlines() | ||
timing = float(lines[0]) | ||
if len(lines) >= 2: | ||
rss = int(lines[1]) | ||
rss = int(lines[1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain about the parsing logic.
see: https://github.com/psf/pyperf/pull/197/files#r1718097565 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good I left a nit comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's just merge
And document. As suggested by @corona10 psf#197 (comment)
This is a follow-on to #193 that makes hooks also work inside of subprocesses created by
bench_command
.