Skip to content

perf(bench): isolate native executable startup from compile-to-result (#746) - #1410

Merged
godofecht merged 1 commit into
mainfrom
fix/746-native-startup-vs-compile-and-run
Oct 7, 2026
Merged

godofecht merged 1 commit into
mainfrom
fix/746-native-startup-vs-compile-and-run

Conversation

@godofecht

@godofecht godofecht commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Part of #746. Does not close it.

Change

The cold_* rows of ./flow tool bench_harness time flow run --json, which compiles and then runs. That is compile-to-result time, and the harness had no row for the startup of an already-built executable.

  • A startup suite reuses the cold sources for hello, tiny_arithmetic and file_transform, with their Python and native twins. The Flow program is built before timing and there is no warm-up.
  • Every row now has a timing_scope: compile_and_execute (cold_*, compiler_*), precompiled_exec_to_exit (startup_*) or precompiled_workload (everything else). --timing-scope WORKLOAD prints it, for tests.
  • benchmarks/README.md says what each scope measures. Startup rows are launch-to-exit wall time. Measuring execve to main is still open on [Performance #727] Minimize compiled-program cold start and runtime initialization overhead #746.

The original branch was cut before #1265 (native baselines) and #1341 (memory-only profiling) and no longer rebased cleanly, so this is a fresh port of its net change onto main 9f1d6d0 in one commit. Its extra profile flag on measure() is dropped because main already profiles only the memory suite.

Evidence

  • ./flow tool tests/bench_harness/run.flow: 61 passed. With main's bench_harness the same test has 6 failures (the five --timing-scope checks and the timing_scope key).
  • ./flow tool bench_harness --smoke: writes startup_hello, startup_tiny_arithmetic and startup_file_transform with precompiled_exec_to_exit and warm_mode: false, 10 compile_and_execute rows and 19 precompiled_workload rows.
  • ./flow tool tests/cli/run.flow: 152 passed, 2 failed (jit_hello, test_mlir: golden drift on main).
  • test-lang and test-runtime were not run: no file they build is touched.
  • Merges cleanly with fix(perf): benchmark correctness and CRLF scanning (#735 #746 #745 #740 #747) #1401 in either order (git merge-tree).

No compiler/src change.

Port of the startup cohort from the original #1410 branch onto main after
#1265 (native baselines). The startup_* rows reuse the cold sources and
twins, build the Flow program before timing, and every row now carries a
timing_scope. The draft's profile flag is dropped: main already profiles
only the memory suite (#1341).
@godofecht
godofecht force-pushed the fix/746-native-startup-vs-compile-and-run branch from fe75fd5 to 956a851 Compare October 7, 2026 11:01
@godofecht
godofecht marked this pull request as ready for review October 7, 2026 11:01
@godofecht
godofecht added this pull request to the merge queue Oct 7, 2026
Merged via the queue into main with commit 1a91a64 Oct 7, 2026
37 checks passed
@godofecht
godofecht deleted the fix/746-native-startup-vs-compile-and-run branch October 12, 2026 23:03
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