Repository navigation
Reuse the buildroot snapshot when packing libraries - #1306
andreybolonin wants to merge 1 commit into
Conversation
|
We do not oppose using AI to complete optimization. But regardless of the content of the modification, I still recommend that before submitting the PR, either be able to provide effective "human confirmation", or only include the necessary build-related fixes. For a large number of unrelated functions that are worth slightly modifying, I suggest merging several PR (only of the same type, like "cli performance") to complete this task, and provide real data to support it. |
|
static-php-cli have many chances to perf gain |
Review for #1306It is a safe but it is just a safe change, also virtually useless. We could certainly review and merge it quickly, but it offers no benefit to our core functionality (in terms of the build process). Review for #1307This is a useful point, though it warrants further triage. In our CI, we use However, before proceeding, I would like to understand how this optimization serves your objectives—rather than simply implementing it without any clear rationale. Review for #1308Similar to #1306, but slightly more useful, can be merged. |
I don't mind tickling the slop machine for gain, but this is just bloating code and maintenance and stealing reviewers time for no gain whatsoever. It doesn't matter if SPC is even 100ms faster after all your optimizations. There are very meaningful optimizations that can be explored, tested, and proposed with some effort. For example skipping builds of extensions or sapis that would lead to byte-identical output. Or even running multiple configures at once, in parallel, done in a smart way to minimise build times of libraries. But all this is just meaningless noise. 100 milliseconds, in the matter of a 30-2h compilation time, are noise. |
|
@henderkes just do nothing ) and use this slow lib |
What does this PR do?
With tracking enabled,
dev:pack-libtakes two snapshots of the same buildroot before each package build. Give the pack stage a clone of the tracker's snapshot so both share the baseline file list. Each consumer still scans for additions at its original point in the lifecycle, and resetting the packing snapshot leaves the tracking baseline intact. Packing with tracking disabled still takes its own baseline.The change applies to the package installer across platforms and requires no recipe, toolchain, or documentation changes. The regression test covers independent snapshot resets and file additions between the packing and tracking scans.
On macOS arm64 with PHP 8.6.0, a benchmark with 20,000 files and 12 snapshot-and-diff cycles per run reduced median time from 3.39 s to 2.55 s (−25%) and median peak RSS from 32.3 MiB to 31.0 MiB (−4%). The benchmark measures the snapshot work only.
Checklist before merging
composer cs-fix -- --sequentialcomposer analysecomposer test(486 tests)bin/spc dev:lint-configValidation ran on macOS arm64 with PHP 8.6.0. Full static builds, end-to-end packing time, and other host platforms were outside the local validation.