Skip to content

General Wrapper Optimizations - #61

Merged
scheibelp merged 3 commits into
spack:mainfrom
johnwparent:optimize-wrapper-performance
Aug 11, 2026
Merged

General Wrapper Optimizations#61
scheibelp merged 3 commits into
spack:mainfrom
johnwparent:optimize-wrapper-performance

Conversation

@johnwparent

@johnwparent johnwparent commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Optimizes wrapper performance in a few primary ways:

  • removes manual stdout/err capture and forwarding
    rather than redirecting the toolchain child processes stdout/err to pipes we read from and write to the wrapper stdout for capture, we directly attach the child to the wrapper's stdout and avoid having to spin a cpu to pipe io streams.
  • Uses waitforsingleobject instead of calling GetExitCodeProcess while waiting for the child object to return.
    GetExitCodeProcess within our while loop introduces a busy wait loop vs allowing the scheduler to pause execution entirely, allowing for more concurrent processing and reducing parallel bottlenecks
  • Builds with more compiler and linker optimizations
  • uses more optimal data structures and types when appropriate
  • When debugging, checks for debug before constructing debug string
  • Reduces frivolous operations (like checking env variables we don't use)
  • Pulls regex utils into its own header so the heavy <regex> header is only included in TUs that actually need it.

Adds a benchmarking test to be run whenever changes to multiprocessing/threading logic are made to ensure continued performant execution of the wrapper.

Signed-off-by: John Parent <john.parent@kitware.com>
Signed-off-by: John Parent <john.parent@kitware.com>
Signed-off-by: John Parent <john.parent@kitware.com>
@scheibelp
scheibelp merged commit ddc50c1 into spack:main Aug 11, 2026
1 check passed
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