Skip to content

pyhl: default surrogate process pool to 1 for library callers - #22

Merged
danbugs merged 1 commit into
mainfrom
fix/surrogate-default-library
May 13, 2026
Merged

pyhl: default surrogate process pool to 1 for library callers#22
danbugs merged 1 commit into
mainfrom
fix/surrogate-default-library

Conversation

@danbugs

@danbugs danbugs commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Move the HYPERLIGHT_INITIAL_SURROGATES=1 default from the pyhl CLI binary into the pyhl library module so Rust callers of pyhl::install / Runtime::new also avoid the ~3.5s startup cost of pre-spawning 512 surrogate processes on Windows.
  • The env var is only set when the caller hasn't already set it, so embedders can still override.
  • Remove the now-redundant setting from bin/pyhl.rs.

Move the HYPERLIGHT_INITIAL_SURROGATES=1 default from the CLI binary
into the pyhl library so Rust callers of pyhl::install / Runtime::new
also avoid the ~3.5s startup cost of pre-spawning 512 surrogate
processes on Windows. Callers can still override via the env var.

Signed-off-by: danbugs <danilochiarlone@gmail.com>
@danbugs
danbugs enabled auto-merge May 13, 2026 21:33

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linux Benchmarks

Details
Benchmark suite Current: 7fc0741 Previous: 094c5cf Ratio
hello_world (median) 10 ms 10 ms 1
pandas (median) 80 ms 80 ms 1
density (per VM) 7 MB 7 MB 1
snapshot (disk) 384 MiB 385 MiB 1.00

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows Benchmarks

Details
Benchmark suite Current: 7fc0741 Previous: 094c5cf Ratio
hello_world (median) 1005 ms 248 ms 4.05
pandas (median) 1678 ms 757 ms 2.22
density (per VM) 6 MB 6 MB 1
snapshot (disk) 392 MiB 392 MiB 1

This comment was automatically generated by workflow using github-action-benchmark.

@danbugs
danbugs merged commit 8affbcc into main May 13, 2026
74 checks passed
@danbugs
danbugs deleted the fix/surrogate-default-library branch May 13, 2026 21:44
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.

1 participant