{"id":32143129,"url":"https://github.com/ordo-one/swift-parca","last_synced_at":"2025-10-21T07:52:38.157Z","repository":{"id":311745317,"uuid":"1044798284","full_name":"ordo-one/swift-parca","owner":"ordo-one","description":"Low-overhead continuous profiling for Swift on Server production environments","archived":false,"fork":false,"pushed_at":"2025-08-26T14:00:15.000Z","size":33,"stargazers_count":51,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-10-21T07:52:30.433Z","etag":null,"topics":["docker","linux","parca","performance","performance-analysis","swift","swift-server"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ordo-one.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-26T08:19:52.000Z","updated_at":"2025-10-20T18:42:46.000Z","dependencies_parsed_at":"2025-08-26T11:37:26.312Z","dependency_job_id":"75118411-bd66-4bdb-b74d-39267c88e72a","html_url":"https://github.com/ordo-one/swift-parca","commit_stats":null,"previous_names":["ordo-one/swift-parca"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ordo-one/swift-parca","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ordo-one%2Fswift-parca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ordo-one%2Fswift-parca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ordo-one%2Fswift-parca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ordo-one%2Fswift-parca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ordo-one","download_url":"https://codeload.github.com/ordo-one/swift-parca/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ordo-one%2Fswift-parca/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280225807,"owners_count":26293888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","linux","parca","performance","performance-analysis","swift","swift-server"],"created_at":"2025-10-21T07:52:35.371Z","updated_at":"2025-10-21T07:52:38.151Z","avatar_url":"https://github.com/ordo-one.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# swift-parca\n\n`swift-parca` supports continuous low-overhead profiling of Swift Server applications at scale, for always-on tracking of performance issues in production.\n\n`swift-parca` is a fully packaged solution that extends [Parca](https://www.parca.dev), an open-source continuous profiling tool that embeds [opentelemetry-ebpf-profiler](https://github.com/parca-dev/opentelemetry-ebpf-profiler) for creating low overhead samples, with native support for Swift symbol demangling.\n\nParca consists of an agent that runs on each node that is under monitoring as well as a server that aggregates all the profiling data for analysis using familiar tools such as flamegraphs and sample overviews.\n\n## Sample output\n### Example of reviewing `swift-build` stacks\n\u003cimg width=\"1449\" height=\"1264\" alt=\"swift-build\" src=\"https://github.com/user-attachments/assets/a7066afd-f417-4a90-b32a-a65d44f8770a\" /\u003e\n\n### Example of `swift-nio` benchmark\n\u003cimg width=\"1710\" height=\"1196\" alt=\"swift-nio\" src=\"https://github.com/user-attachments/assets/75d13bee-84d2-4d13-840b-e34a1395539a\" /\u003e\n\n## 🚀 Getting Started\n`swift-parca` is provided as a single, pre-configured Docker container image that bundles Parca and all necessary dependencies, to simplify profiling of Swift applications at scale.\n\nTo begin profiling your Swift application, follow these simple steps:\n\n1. Start the Parca Server\n\nUse the provided `docker-compose.yml` to bring up the Parca server:\n```bash\ndocker compose up -d\n```\n\nThis starts the Parca server, listening on HTTP port 7070 for UI and profiling data from agents.\n\n2. Start the Parca Agent\n\nOn each server running your Swift workloads, deploy the `parca-agent`:\n```bash\nexport REMOTE_STORE_ADDRESS=\u003cPARCA_SERVER_IP\u003e:7070\ndocker-compose -f docker-compose.agent.yml up -d\n```\n\n## Documentation\n\nFor further setup and usage instructions, please refer to the [Parca Documentation](https://www.parca.dev/docs/overview).\n\n## Performance Overhead\n\n[Parca agent](https://github.com/parca-dev/parca-agent) samples [19 times per second](https://www.parca.dev/docs/parca-agent-design/#obtaining-raw-data) per core, only the stack addresses are aggregated in eBPF maps; the rest of the processing is sending them and binaries to the server, where demangling/symbolicatition happens on demand when a trace is viewed. In practice this results in neglible overhead on the profiled application, that can be sub 1%.\n\n## Background \n\nParca normally uses a [Go demangler](https://github.com/ianlancetaylor/demangle) which [lacks Swift symbol](https://github.com/ianlancetaylor/demangle/issues/16) demangling. \n\nThis project addresses this limitation by configuring Parca to delegate address-to-line lookups and symbol demangling to a custom `swift-addr2line` embedded tool. This tool leverages the native Swift runtime function for demangling, ensuring accurate and human-readable stack traces, while relying on a Rust-based [`gimli` addr2line](https://github.com/gimli-rs/addr2line) (or to [`llvm-addr2line`](https://llvm.org/docs/CommandGuide/llvm-addr2line.html)) for actual address lookup. \n\nThis direct access of the native Swift runtime function is needed until [SE-262](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0262-demangle.md) is formally integrated into the standard library.\n\n## Using llvm-addr2line\n\nIf you want to use [`llvm-addr2line`](https://llvm.org/docs/CommandGuide/llvm-addr2line.html) instead of the `gimli-rs/addr2line`, uncomment the line containing `apt-get install -y llvm-19` in the Dockerfile.\n\nThis installs the LLVM tools, making the binary available at `/usr/bin/llvm-addr2line-19`.\n\nThen you need to update the `docker-compose.yml` environment:\n\n```bash\n    environment:\n      - ADDR2LINE_PATH=/usr/bin/llvm-addr2line-19\n```\n\n## Requirements\n\nThe container is packaged for Linux x86_64 and ARM64. It is possible to run entirely under a Linux VM (with kernel 5.4+) under Apple sillicon.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fordo-one%2Fswift-parca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fordo-one%2Fswift-parca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fordo-one%2Fswift-parca/lists"}