{"id":16218098,"url":"https://github.com/quasilyte/qpprof","last_synced_at":"2025-07-21T16:06:47.365Z","repository":{"id":85823328,"uuid":"448269714","full_name":"quasilyte/qpprof","owner":"quasilyte","description":"A helper tool to work with profile.proto (pprof) files","archived":false,"fork":false,"pushed_at":"2022-05-11T10:47:58.000Z","size":17,"stargazers_count":60,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-03T01:51:10.342Z","etag":null,"topics":["cli","cpu","go","golang","performance","pprof","profiling","utility"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quasilyte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-01-15T12:22:31.000Z","updated_at":"2024-05-23T18:30:01.000Z","dependencies_parsed_at":"2023-03-05T14:00:25.487Z","dependency_job_id":null,"html_url":"https://github.com/quasilyte/qpprof","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/quasilyte/qpprof","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quasilyte%2Fqpprof","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quasilyte%2Fqpprof/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quasilyte%2Fqpprof/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quasilyte%2Fqpprof/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quasilyte","download_url":"https://codeload.github.com/quasilyte/qpprof/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quasilyte%2Fqpprof/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266332534,"owners_count":23912662,"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-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["cli","cpu","go","golang","performance","pprof","profiling","utility"],"created_at":"2024-10-10T11:48:28.768Z","updated_at":"2025-07-21T16:06:47.337Z","avatar_url":"https://github.com/quasilyte.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qpprof\n\nqpprof complements the [pprof](https://github.com/google/pprof) tool.\n\n## Commands\n\nUse `qpprof command --help` to get more information.\n\n### Flat aggregation\n\nAlternative flat aggregations allow you to get the `top` with some of the\nnodes being folded to their callers.\n\nFor instance, take this `copyBytes()` function:\n\n```go\nfunc copyBytes(b []byte) []byte {\n  dst := make([]byte, len(b))\n  copy(dst, b)\n  return dst\n}\n```\n\nIf you benchmark it and use `pprof top`, then you'll see this:\n\n```\n(pprof) top 5\n37.56% runtime.mallocgc\n12.16% runtime.memclrNoHeapPointers\n 9.35% runtime.memmove\n 8.47% runtime.scanobject\n 6.42% runtime.scanblock\n```\n\nWith `flat-with-runtime` you'll get something that you would expect:\n\n```bash\n$ qpprof flat-with-runtime cpu.out\n6.25s example.copyBytes\n 40ms example.BenchmarkCopyBytes\n 20ms testing.(*B).runN\n```\n\nThere is also `flat-with-stdlib` that folds all standard library functions,\nnot just the `runtime` package.\n\n### Enriching the profile\n\nGiven a CPU profile `X` and executable `E` that was used to collect it, we can\ngenerate a new CPU profile `Y` that contains even more useful information.\n\nWhat we can add to the profile:\n\n* Explicit bound checks timings (displayed as `runtime.boundcheck`)\n* Explicit nil checks timings (displayed as `runtime.nilcheck`)\n\n```bash\n$ qpprof enrich -o=cpu2.out -exe=prog cpu.out\nruntime.boundcheck: 7 samples (300ms)\nruntime.nilcheck: 22 samples (300ms)\n```\n\nNow let's open `cpu2.out` with pprof:\n\n```\n(pprof) top boundcheck|nilcheck\nActive filters:\n   focus=boundcheck|nilcheck\nShowing nodes accounting for 0.60s, 1.10% of 54.68s total\nShowing top 10 nodes out of 132\n      flat  flat%   sum%        cum   cum%\n     0.30s  0.55%  0.55%      0.30s  0.55%  runtime.boundcheck (inline)\n     0.30s  0.55%  1.10%      0.30s  0.55%  runtime.nilcheck (inline)\n```\n\nThe implicit bound checks are now explicit, visible in the profile.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquasilyte%2Fqpprof","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquasilyte%2Fqpprof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquasilyte%2Fqpprof/lists"}