Skip to content

prof: profile a compiled server under load (serve.sh, report.php thread mode, docs/profiling.md) - #561

Merged
blacktrs merged 3 commits into
mainfrom
chore/prof-serve
Nov 3, 2026
Merged

blacktrs merged 3 commits into
mainfrom
chore/prof-serve

Conversation

@blacktrs

@blacktrs blacktrs commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Why

tools/prof profiled only the compiler. There was no way to see where a compiled server (symfony-app) spends a request.

What

  • tools/prof/serve.sh [--build] <app-dir> [path]: builds bin/app.prof with MANTICORE_FRAME_POINTERS=1 once, runs it with one worker, loads it with wrk, samples the worker with macOS sample, prints the report. Artifacts are removed on exit (KEEP=1 keeps them).
  • report.php thread <sample.txt> [top] [thread]: one thread's SELF and INCLUSIVE time from sample's call tree. The existing sample mode sums every thread, so a pool idling in read(2) hid the main thread (82% of the table).
  • docs/profiling.md, a README line and a row in tools/prof/README.md.

Frame pointers matter: without them sample cuts each stack at the first function without a frame record and inclusive numbers are meaningless.

First reading (symfony-app, GET /, one worker, main thread)

Kernel::handle 62%, HttpKernel::handleRaw 50%, EventDispatcher::dispatch 31%, RouterListener::onKernelRequest 13%, Kernel::boot 11% and ServicesResetter::reset 10% on every request, Request::createFromGlobals 7%, socket I/O about 11%.

Not run

Linux (macOS sample only; tools/docker/prof is the Linux path). No src/ change, so no gate impact.

@blacktrs
blacktrs merged commit 11a84d5 into main Nov 3, 2026
6 checks passed
@blacktrs
blacktrs deleted the chore/prof-serve branch November 3, 2026 08:06
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