profiling-sct-code

Profile Python code in SCT tests with cProfile, Scalene, and Memray.

73|112|Updated Dec 29, 2015
One-click install
npx skills add https://github.com/scylladb/scylla-cluster-tests --skill profiling-sct-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: profiling-sct-code
Source: https://github.com/scylladb/scylla-cluster-tests/tree/main/skills/profiling-sct-code
Command: npx skills add https://github.com/scylladb/scylla-cluster-tests --skill profiling-sct-code

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires cProfile, scalene, memray, py-spy, snakeviz, pytest-memray, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps identify and resolve performance bottlenecks within the SCT (Scylla Cluster Tests) framework, such as slow operations, memory leaks, or high CPU usage.

Core Features & Use Cases

  • CPU Profiling: Pinpoint functions or lines consuming the most CPU time using cProfile or Scalene.
  • Memory Profiling: Detect memory leaks and analyze allocation patterns with Memray.
  • Concurrency Analysis: Understand execution flow across threads.
  • Use Case: When a specific SCT test suite consistently takes too long to run, this Skill can be used to profile its execution, identify the slowest parts, and guide optimization efforts.

Quick Start

Profile a unit test using cProfile and then visualize the results with snakeviz.

Frequently Asked Questions about profiling-sct-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I profile Python code to find CPU bottlenecks in Scylla Cluster Tests?

To profile Python code in Scylla Cluster Tests, you can use cProfile or Scalene to pinpoint functions consuming the most CPU time. This identifies performance bottlenecks and guides optimization efforts for slow test runs.

Can I profile an individual unit test instead of a full SCT test run?

Yes, profiling supports both individual unit tests and full SCT test runs. You can profile a unit test using cProfile and then visualize the execution results with snakeviz to debug performance bottlenecks.

How does concurrency analysis work when debugging SCT performance issues?

Concurrency analysis helps understand execution flow across threads during SCT test runs. By profiling this flow, you can identify threading bottlenecks and optimize execution speed and resource utilization.

What is the best way to visualize cProfile results for Python performance debugging?

The best way to visualize cProfile results is by using snakeviz. After profiling your Python unit test with cProfile, snakeviz displays the execution data to help you identify and resolve performance bottlenecks.

Does Scalene work with pytest-memray for SCT memory profiling?

Scalene focuses on CPU profiling while pytest-memray integrates memory profiling into test suites. Both are supported within the SCT framework to diagnose high CPU usage and memory leaks.