Wink Pings

PHP's git --version call is 62% faster — it's time to lower the fixed tax on short-lived processes

A new symfony/process PR reran the short-process benchmarks: git --version went from 1.61ms to 0.61ms, and echo hi went from 1.41ms to 0.41ms. On a single CPU, first call also improved by 45% to 51%. Don't underestimate these milliseconds.

symfony/process has undergone a round of optimization for short-lived processes. m@ttias posted a set of benchmarks in a tweet, pointing to symfony/symfony PR #67827: running the PHP benchmark on a single CPU, with PHP and the child process on the same core, noticeably reduced the time taken by short commands.

symfony/process short process performance improvement comparison table

The table shows four scenarios:

  • git --version went from 1.61ms to 0.61ms, a 62.1% improvement
  • git --version, first call went from 2.22ms to 1.20ms, a 45.7% improvement
  • echo hi went from 1.41ms to 0.41ms, a 71.3% improvement
  • echo hi, first call went from 2.02ms to 0.98ms, a 51.6% improvement

symfony/process is the component in the PHP ecosystem for starting and managing child processes. Many CLI tools, test scripts, and build pipelines use it to call external commands. If you don't write PHP, you can think of it as a layer of process-startup glue: one program asks another program to do work, and in between there is a fixed overhead for creating the process, initializing it, and cleaning up resources.

What's interesting about this data is that what was optimized is not long-running tasks, but commands so short they are easy to overlook. A single git --version or echo hi is only milliseconds, but when called repeatedly in loops, test suites, CI, and editor plugins, it becomes a fixed tax you keep paying. The first-call data also shows that initialization cost is still there, but the path is already shorter.

The 62% figure is under a specific benchmark and won't be reproducible in every scenario. The single-CPU condition also means concurrency and scheduling factors are kept very low. What is certain is that the PR changed the short-process path, and the gains come from reducing unnecessary overhead. This kind of change doesn't add features or create new concepts, but it saves callers money every day. The most easily overlooked gains in engineering often hide in exactly this kind of place.

Source: https://x.com/mattiasgeniar/status/2117679493649469646

PR: https://github.com/symfony/symfony/pull/67827

发布时间: 2026-11-04 02:30