Skip to content

Add --in-process mode support - #234

Merged
corona10 merged 11 commits into
psf:mainfrom
ryanking13:inprocess-runner
Nov 3, 2026
Merged

corona10 merged 11 commits into
psf:mainfrom
ryanking13:inprocess-runner

Conversation

@ryanking13

Copy link
Copy Markdown
Contributor

Resolve #233

Adds --in-process mode as proposed in #233. It enables running pyperf in browser-based environments like Pyodide.

@vstinner vstinner left a comment

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.

I would prefer to limit this PR to the --in-process option, and move the PyOdide changes to a separated PR (later).

@ryanking13

Copy link
Copy Markdown
Contributor Author

@vstinner Sure, sounds good. I remove pyodide-related changes from the PR.

@ryanking13
ryanking13 requested a review from vstinner February 23, 2026 04:42
@ryanking13

Copy link
Copy Markdown
Contributor Author

@vstinner @corona10 May I ask your review again when you have a chance?

@corona10 corona10 self-assigned this Oct 21, 2026
@corona10

Copy link
Copy Markdown
Member

@ryanking13 I will take a look at this week cc @vstinner @hoodmane

Comment thread pyperf/_runner.py Resolved

@corona10 corona10 left a comment

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.

Overall looks good to me, but could you check the https://github.com/psf/pyperf/pull/234/changes#r4341703877 this change is actually needed.

@ryanking13
ryanking13 requested a review from corona10 October 23, 2026 04:12

@corona10 corona10 left a comment

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.

lgtm

@corona10
corona10 merged commit 05717d9 into psf:main Nov 3, 2026
@ryanking13

Copy link
Copy Markdown
Contributor Author

Thanks @corona10! Is there any plan to release a new version?

@corona10

corona10 commented Nov 3, 2026

Copy link
Copy Markdown
Member

Let me do at this week

@ryanking13
ryanking13 deleted the inprocess-runner branch November 4, 2026 02:59
@vstinner

vstinner commented Nov 4, 2026

Copy link
Copy Markdown
Member

@ryanking13: Would you mind to create a follow-up PR to document the new option in https://pyperf.readthedocs.io/en/latest/runner.html?

@vstinner

vstinner commented Nov 4, 2026

Copy link
Copy Markdown
Member

So I tried python -m pyperf timeit '[1,2]*1000' --in-process -v. It computes 1 calibration run + 20 runs. Each run is made of 1 warmup value + 3 values.

I don't see the purpose of computing more than 1 warmup value in total if all values are computed in the same process. Moreover, I don't see the purpose of having 20 "runs" if we are computing all of them in the same process.

Instead, I would expect to have 1 run for the loops calibration and 1 run with 60 values.

@vstinner

vstinner commented Nov 4, 2026

Copy link
Copy Markdown
Member

I created #271 to compute all values in a single process.

@vstinner

vstinner commented Nov 4, 2026

Copy link
Copy Markdown
Member

@ryanking13: Would you mind to create a follow-up PR to document the new option in https://pyperf.readthedocs.io/en/latest/runner.html?

Oh, please add also an entry in doc/changelog.rst (you should add a new Version 2.11 section).

@ryanking13

Copy link
Copy Markdown
Contributor Author

@ryanking13: Would you mind to create a follow-up PR to document the new option in https://pyperf.readthedocs.io/en/latest/runner.html?

Sure will do!

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.

Add --in-process runner mode for environments without subprocess support

3 participants