Skip to content

Make hooks work in bench_command subprocesses#197

Merged
corona10 merged 2 commits intopsf:mainfrom
mdboom:subprocess-hooks
Aug 27, 2024
Merged

Make hooks work in bench_command subprocesses#197
corona10 merged 2 commits intopsf:mainfrom
mdboom:subprocess-hooks

Conversation

@mdboom
Copy link
Copy Markdown
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
Copy Markdown
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)

hook.teardown(metadata)

# Write timing in seconds into stdout
print(dt)
Copy link
Copy Markdown
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?

timing = float(lines[0])
if len(lines) >= 2:
rss = int(lines[1])
rss = int(lines[1])
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

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