Skip to content
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

Merged
merged 2 commits into from
Aug 27, 2024

Conversation

mdboom
Copy link
Collaborator

@mdboom mdboom commented Jul 29, 2024

This is a follow-on to #193 that makes hooks also work inside of subprocesses created by bench_command.

@mdboom mdboom requested a review from corona10 July 29, 2024 15:12
@mdboom mdboom marked this pull request as draft July 29, 2024 15:21
@mdboom mdboom marked this pull request as ready for review July 29, 2024 15:55
Copy link
Member

@corona10 corona10 left a 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)
Copy link
Member

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])
Copy link
Member

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 :)

Copy link
Member

@corona10 corona10 left a 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.

Copy link
Member

@corona10 corona10 left a 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

@corona10 corona10 merged commit a833224 into psf:main Aug 27, 2024
13 checks passed
mdboom added a commit to mdboom/pyperf that referenced this pull request Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants