{
  "markdown": "# Lazyline: Zero-Config Line-Level Python Profiler\n\n[![PyPI version](https://img.shields.io/pypi/v/lazyline)](https://pypi.org/project/lazyline/)\n[![Downloads](https://img.shields.io/pypi/dm/lazyline)](https://pypi.org/project/lazyline/)\n[![Python versions](https://img.shields.io/pypi/pyversions/lazyline)](https://pypi.org/project/lazyline/)\n[![Tests](https://github.com/TomasVenkrbec/lazyline/actions/workflows/ci.yml/badge.svg)](https://github.com/TomasVenkrbec/lazyline/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/TomasVenkrbec/lazyline/graph/badge.svg)](https://codecov.io/gh/TomasVenkrbec/lazyline)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/TomasVenkrbec/lazyline/blob/main/LICENSE)\n\n**Zero-config, deterministic, line-level Python profiler.**\nFind slow Python code and profile it line by line — no `@profile`\ndecorators, no code changes. Point it at a package or script and get\nexact hit counts and timing for every line. Subprocesses and\nmultiprocessing pools profiled automatically. Find the lazy lines.\n\n## Quick Start\n\n```bash\npip install lazyline\n# or: uvx lazyline\n\n# Profile a package while running its tests:\nlazyline run my_package -- pytest tests/\n\n# Profile a script:\nlazyline run script.py -- python script.py\n```\n\n![Lazyline demo](assets/demo.gif)\n\nLine 14 burned 99.8% of `deduplicate` checking membership in a list\non every iteration — that's your lazy line. Change `seen` to a `set`\nand it drops from O(n²) to O(n).\n\n> [!TIP]\n> Using an AI coding assistant? Install the\n> [lazyline plugin](#claude-code-plugin) for Claude Code, or copy\n> [`skills/lazyline/SKILL.md`](skills/lazyline/SKILL.md) into any\n> assistant that supports markdown skill files.\n\n## Key Features\n\nNeed to find performance bottlenecks in your Python code without\nmodifying a single file? Lazyline wraps\n[line_profiler](https://github.com/pyutils/line_profiler) and adds\neverything needed to go from \"I want to profile this package\" to\n\"here are the bottlenecks\" in a single command:\n\n- **Zero configuration** — point at a package name, directory, or\n  `.py` file. Every function is discovered and instrumented\n  automatically. No `@profile` decorators, no code changes — be lazy,\n  let the tool do the work.\n\n- **Subprocess and multiprocessing** — `ProcessPoolExecutor`,\n  `multiprocessing.Pool`, and child Python processes (Celery workers,\n  Airflow tasks) are profiled automatically. Results are merged\n  into a single report.\n\n- **Deterministic precision** — exact hit counts and timing for every\n  line, not statistical estimates. \"This line ran 47,382 times and\n  took 3.2s.\" When you need to distinguish O(n) from O(n²), exact\n  counts are the difference.\n\n- **Focused scope, clean output** — you choose exactly which package\n  to profile. Unlike tools that profile everything in your working\n  directory, lazyline keeps output relevant and overhead contained.\n\n## When to Use What\n\nNo tool is best for everything. Pick the right one for the job:\n\n| You need... | Use | Why |\n| ------------- | ----- | ----- |\n| Exact line-level timing across a package, no code changes | **[lazyline](https://github.com/TomasVenkrbec/lazyline)** | Deterministic tracing with auto-discovery and subprocess support |\n| Low-overhead profiling with memory, GPU, and AI suggestions | **[Scalene](https://github.com/plasma-umass/scalene)** | Sampling (~10-20% overhead), broad feature set, web UI |\n| Attach to a running process in production | **[py-spy](https://github.com/benfred/py-spy)** | Out-of-process sampling, near-zero overhead, no restart needed |\n| \"Which function is slow?\" with beautiful call trees | **[Pyinstrument](https://github.com/joerick/pyinstrument)** | Statistical profiler, tree output, low overhead |\n\n### Feature comparison\n\n| Feature | lazyline | kernprof | Scalene | py-spy | Pyinstrument | cProfile |\n| --------- | ---------- | ---------- | --------- | -------- | -------------- | ---------- |\n| Granularity | Line | Line | Line | Line | Function | Function |\n| Method | Deterministic | Deterministic | Sampling | Sampling | Sampling | Deterministic |\n| Code changes needed | None | `@profile` | None | None | None | None |\n| Exact hit counts | Yes | Yes | No | No | No | Yes (fn-level) |\n| Subprocess profiling | Automatic | No | Partial | Yes | No | No |\n| Multiprocessing pools | Automatic | No | Partial | Yes | No | No |\n| Memory profiling | Opt-in | No | Built-in | No | No | No |\n| GPU profiling | No | No | Yes | No | No | No |\n| Overhead | 1.2–7x | 1.2–7x | ~10–20% | ~0% | Low | Moderate |\n\n**Lazyline trades overhead for precision.** Deterministic tracing fires\na callback on every line execution. For functions with real work (>0.1ms\nper call), overhead is negligible (~1.2x). For tight loops calling tiny\nfunctions millions of times, it can reach ~7x. Relative rankings are\nalways reliable — use lazyline to find *which* code is lazy, not to\nmeasure *how fast* it runs. See\n[benchmarks](https://github.com/TomasVenkrbec/lazyline/blob/main/benchmarks/README.md)\nfor detailed measurements.\n\n## Usage\n\n```bash\n# Profile a package during its test suite\nlazyline run my_package -- pytest tests/\n\n# Profile while running a script\nlazyline run my_package -- python evaluate.py\n\n# Profile a CLI tool (hyphenated console scripts work too)\nlazyline run my_package -- my-tool run-all\n\n# Export results, view later\nlazyline run -o results.json my_package -- pytest tests/\nlazyline show results.json --top 10\n\n# Multiple scopes in one run\nlazyline run utils.py my_package -- python script.py\n```\n\nRequires Python 3.10+. The target package must be importable in the\nsame environment.\n\nSee the\n[full usage guide](https://github.com/TomasVenkrbec/lazyline/blob/main/docs/usage.md)\nfor all CLI options, scope formats, command resolution, output details,\nand more examples.\n\n## Claude Code Plugin\n\nLazyline ships as a [Claude Code plugin](https://docs.anthropic.com/en/docs/claude-code/plugins).\nInstall it and Claude will know how to profile your code, interpret\nresults, and suggest optimizations:\n\n```bash\n/plugin marketplace add TomasVenkrbec/lazyline\n/plugin install lazyline@lazyline\n```\n\nThen use `/lazyline my_package -- python main.py` or let Claude invoke\nit automatically when you ask about performance.\n\nThe skill also works with any AI coding assistant that supports\nmarkdown skill files — copy\n[`skills/lazyline/SKILL.md`](skills/lazyline/SKILL.md)\ninto your assistant's configuration.\n\n## Documentation\n\n- **[Usage Guide][docs-usage]** — CLI reference, scope formats,\n  output details\n- **[How It Works][docs-how]** — architecture, overhead, limitations\n- **[Benchmarks][docs-bench]** — overhead measurements and methodology\n- **[Contributing][docs-contrib]** — development setup, tests,\n  code style\n- **[Changelog][docs-changelog]**\n\n[docs-usage]: https://github.com/TomasVenkrbec/lazyline/blob/main/docs/usage.md\n[docs-how]: https://github.com/TomasVenkrbec/lazyline/blob/main/docs/how-it-works.md\n[docs-bench]: https://github.com/TomasVenkrbec/lazyline/blob/main/benchmarks/README.md\n[docs-contrib]: https://github.com/TomasVenkrbec/lazyline/blob/main/CONTRIBUTING.md\n[docs-changelog]: https://github.com/TomasVenkrbec/lazyline/blob/main/CHANGELOG.md\n\n---\n\nIf lazyline helped you find a bottleneck, consider giving it a\n[star](https://github.com/TomasVenkrbec/lazyline) — it helps others\ndiscover the project. Found a problem?\n[Open an issue](https://github.com/TomasVenkrbec/lazyline/issues).\n\n## License\n\nMIT — see [LICENSE](https://github.com/TomasVenkrbec/lazyline/blob/main/LICENSE).\n",
  "bytes": 7574,
  "sha": "a04ce5c258990754c3a16ad24c1d7198feaeb5c88e6c6c4ac31e7eebc50f2d71",
  "repo_slug": "tomasvenkrbec/lazyline",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_tomasvenkrbec_lazyline_lazyline_9f4cfa14/readme"
}