Search

PythonReactSEOPDF
GitHub Skill

profile

指定したコードの実行速度をプロファイリングし、ボトルネックを特定する

tatsuki-washimi☆ 0 Repository stars0 Repository forks

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

View source ↗Guides

Skill instructions

Profile Code

This skill helps find performance bottlenecks in the code.

Instructions

  1. Identify Target:

    • Ask user for the script or function call to profile.
  2. Run Profiler:

    • Simple Timer: For quick checks, wrap code in time.perf_counter().
    • cProfile: Run python -m cProfile -s cumulative <script_name.py>.
    • Line Profiler: If detailed line-by-line analysis is needed, suggesting adding @profile decorator and running kernprof -l -v <script_name.py> (requires line_profiler installed).
  3. Analyze Output:

    • Look for functions with high cumtime (cumulative time).
    • Look for functions with high call counts (ncalls).
  4. Report:

    • Summarize which parts of the code are consuming the most time.
    • Suggest potential optimizations (vectorization, caching, algorithm change).

Examples

Read the usage examples in the source repository.

View source ↗

Source history

Indexed on
2026-01-20
Index updated
2026-01-26
Branch
main

Index and sync dates describe this directory. View the source repository for code history.

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!