Skip to content

perf: build only selected run targets#1293

Open
krystophny wants to merge 1 commit into
fortran-lang:mainfrom
krystophny:perf/build-selected-run-targets
Open

perf: build only selected run targets#1293
krystophny wants to merge 1 commit into
fortran-lang:mainfrom
krystophny:perf/build-selected-run-targets

Conversation

@krystophny

@krystophny krystophny commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Build only the selected run or test executable targets and their dependency closure
  • cmd_run already filters executable names with should_be_run; before this
    change it still passed the full target list to build_package, building
    unrelated executables

Merge order

Independent PRs (any order):

Stacked chain (merge in order):

  1. Fortran compiles via argv (feat: exec Fortran compiles via argv (posix_spawn/CreateProcess) #1299)
  2. Parallel link/archive via argv (feat: run link and archive in parallel via argv spawn #1300)
  3. C/C++ compiles via argv (feat: exec C/C++ compiles via argv, close the shell-fork gap #1301)

Fork-safety fix:

After the above:

Verification

$ fpm build --features openmp --compiler gfortran --flag '-O3 -g'
[100%] Project compiled successfully.

$ fpm test
TALLY;TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
PASSED: all 35 tests passed

Benchmark (fpm self-test --target fpm-test, median of 3):

parallel: 30.51s main, 30.45s branch, 0.06s faster, 0.2%
serial:   36.85s main, 36.28s branch, 0.57s faster, 1.5%

Nearly neutral on fpm because fpm-test pulls in the full dependency set.
The branch matters most for packages with many independent executables and a
narrow selected target.

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