Swift Profile Recorder
Johannes Weiss and Mitchell Allison (forum):
Swift Profile Recorder, an in-process sampling profiler for Swift services, is now available as an open source project.
[…]
Swift Profile Recorder enables you to:
- Adopt profiling without extra privileges or system dependencies, allowing you to add profiling across a variety of compute environments with constrained permissions.
- Collect samples using
curl, allowing you to easily read profiler output via an HTTP endpoint without needing to learn specific tooling like perf, sample, DTrace, or eBPF (bpftrace).- Integrate with existing tools for visualization and analysis by supporting multiple industry-standard formats, including Linux perf script format, both the pprof file format as well as the
/debug/pprof/profileendpoints, and also the collapsed format as used by the original FlameGraphs.Apple has used Swift Profile Recorder at scale for several years as a tool for operating and debugging Swift services in production. Alongside the recent announcement of swift-parca, the Swift server ecosystem now has multiple profiling tools and approaches.
I’m intrigued by the idea of an app being able to profile itself.
1 Comment RSS · Twitter · Mastodon
The concept has been around for a while, at least in the limited form that gprof supports (last I checked gcc still supports it). But it is also limited, the main one being that it's well-suited for CPU-bound code, starts breaking down with I/O-bound code, and is completely useless for code that induces downstream kernel activity (e.g. concurrent use of a filesystem and the kernel activity that results, for instance in the cache in RAM that buffers writes to the storage device). I have found that most, though not all, of my profiling activity requires a systemic scope.