Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
beita6969 avatar

Performance Profiling

  • 17 installs
  • 869 repo stars
  • Updated June 8, 2026
  • beita6969/scienceclaw

performance-profiling is a skill that analyzes computational simulation timing, scaling, and memory to identify bottlenecks and recommend optimizations.

About

This skill analyzes computational simulation performance to find bottlenecks and recommend optimizations. A developer uses it when simulations are slow or when investigating parallel efficiency and memory needs. It ships four scripts for timing analysis, scaling studies, memory profiling, and bottleneck detection, each emitting JSON, with interpretation tables for the results.

  • Bundled scripts for timing, scaling, memory profiling, and bottleneck detection
  • Threshold tables for phase dominance, parallel efficiency, and memory usage
  • Uses only the Python standard library; runs on Linux, macOS, and Windows

Performance Profiling by the numbers

  • 17 all-time installs (skills.sh)
  • Ranked #407 of 597 Debugging skills by installs in the Skillselion catalog
  • Data as of Aug 2, 2026 (Skillselion catalog sync)
At a glance

performance-profiling capabilities & compatibility

Capabilities
timing analysis · scaling analysis · memory profiling · bottleneck detection
Use cases
debugging
Platforms
Linux · macOS · Windows
Pricing
Free
From the docs

What performance-profiling says it does

Identify computational bottlenecks, analyze scaling behavior, estimate memory requirements, and receive optimization recommendations for any computational simulation.
SKILL.md
No external dependencies (uses Python standard library only)
SKILL.md
Works on Linux, macOS, and Windows
SKILL.md
npx skills add https://github.com/beita6969/scienceclaw --skill performance-profiling

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs17
repo stars869
Last updatedJune 8, 2026
Repositorybeita6969/scienceclaw

What it does

Profile simulation timing, scaling, and memory to identify bottlenecks and recommend optimizations.

Who is it for?

Developers diagnosing slow simulations and planning compute resource allocation

Skip if: Profiling web apps or general application code; it targets computational simulations

When should I use this skill?

Simulations are slow, or the user investigates parallel efficiency, memory needs, or bottlenecks

What you get

JSON reports of slow phases, scaling efficiency, memory estimates, and actionable optimization recommendations.

  • timing analysis JSON
  • scaling efficiency report
  • memory profile

By the numbers

  • 4 profiling scripts
  • 3 threshold metric tables

Files

SKILL.mdMarkdownGitHub ↗

Performance Profiling

Goal

Provide tools to analyze simulation performance, identify bottlenecks, and recommend optimization strategies for computational materials science simulations.

Requirements

  • Python 3.8+
  • No external dependencies (uses Python standard library only)
  • Works on Linux, macOS, and Windows

Inputs to Gather

Before running profiling scripts, collect from the user:

InputDescriptionExample
Simulation logLog file with timing informationsimulation.log
Scaling dataJSON with multi-run performance datascaling_data.json
Simulation parametersJSON with mesh, fields, solver configparams.json
Available memorySystem memory in GB (optional)16.0

Decision Guidance

When to Use Each Script

Need to identify slow phases?
├── YES → Use timing_analyzer.py
│         └── Parse simulation logs for timing data
│
Need to understand parallel performance?
├── YES → Use scaling_analyzer.py
│         └── Analyze strong or weak scaling efficiency
│
Need to estimate memory requirements?
├── YES → Use memory_profiler.py
│         └── Estimate memory from problem parameters
│
Need optimization recommendations?
└── YES → Use bottleneck_detector.py
          └── Combine analyses and get actionable advice

Choosing Analysis Thresholds

MetricGoodAcceptablePoor
Phase dominance<30%30-50%>50%
Parallel efficiency>0.800.70-0.80<0.70
Memory usage<60%60-80%>80%

Script Outputs (JSON Fields)

ScriptKey Outputs
timing_analyzer.pytiming_data.phases, timing_data.slowest_phase, timing_data.total_time
scaling_analyzer.pyscaling_analysis.results, scaling_analysis.efficiency_threshold_processors
memory_profiler.pymemory_profile.total_memory_gb, memory_profile.per_process_gb, memory_profile.warnings
bottleneck_detector.pybottlenecks, recommendations

Workflow

Complete Profiling Workflow

1. Analyze timing from simulation logs 2. Analyze scaling from multi-run data (if available) 3. Profile memory from simulation parameters 4. Detect bottlenecks and get recommendations 5. Implement optimizations based on recommendations 6. Re-profile to verify improvements

Quick Profiling (Timing Only)

1. Run timing analyzer on simulation log 2. Identify dominant phases (>50% of runtime) 3. Apply targeted optimizations to dominant phases

CLI Examples

Timing Analysis

# Basic timing analysis
python3 scripts/timing_analyzer.py \
    --log simulation.log \
    --json

# Custom timing pattern
python3 scripts/timing_analyzer.py \
    --log simulation.log \
    --pattern 'Step\s+(\w+)\s+took\s+([\d.]+)s' \
    --json

Scaling Analysis

# Strong scaling (fixed problem size)
python3 scripts/scaling_analyzer.py \
    --data scaling_data.json \
    --type strong \
    --json

# Weak scaling (constant work per processor)
python3 scripts/scaling_analyzer.py \
    --data scaling_data.json \
    --type weak \
    --json

Memory Profiling

# Estimate memory requirements
python3 scripts/memory_profiler.py \
    --params simulation_params.json \
    --available-gb 16.0 \
    --json

Bottleneck Detection

# Detect bottlenecks from timing only
python3 scripts/bottleneck_detector.py \
    --timing timing_results.json \
    --json

# Comprehensive analysis with all inputs
python3 scripts/bottleneck_detector.py \
    --timing timing_results.json \
    --scaling scaling_results.json \
    --memory memory_results.json \
    --json

Conversational Workflow Example

User: My simulation is taking too long. Can you help me identify what's slow?

Agent workflow: 1. Ask for simulation log file 2. Run timing analyzer:

   python3 scripts/timing_analyzer.py --log simulation.log --json

3. Interpret results:

  • If solver dominates (>50%): Recommend preconditioner tuning
  • If assembly dominates: Recommend caching or vectorization
  • If I/O dominates: Recommend reducing output frequency

4. If user has multi-run data, analyze scaling:

   python3 scripts/scaling_analyzer.py --data scaling.json --type strong --json

5. Generate comprehensive recommendations:

   python3 scripts/bottleneck_detector.py --timing timing.json --scaling scaling.json --json

Interpretation Guidance

Timing Analysis

ScenarioMeaningAction
Solver >70%Solver-dominatedTune preconditioner, check tolerance
Assembly >50%Assembly-dominatedCache matrices, vectorize, parallelize
I/O >30%I/O-dominatedReduce frequency, use parallel I/O
Balanced (<30% each)Well-balancedLook for algorithmic improvements

Scaling Analysis

EfficiencyMeaningAction
>0.80Excellent scalingContinue scaling up
0.70-0.80Good scalingMonitor at larger scales
0.50-0.70Poor scalingInvestigate communication/load balance
<0.50Very poor scalingReduce processor count or redesign

Memory Profile

UsageMeaningAction
<60% availableSafeNo action needed
60-80% availableModerateMonitor, consider optimization
>80% availableHighReduce resolution or increase processors
>100% availableExceeds capacityMust reduce problem size

Error Handling

ErrorCauseResolution
Log file not foundInvalid pathVerify log file path
No timing data foundPattern mismatchProvide custom pattern with --pattern
At least 2 runs requiredInsufficient dataProvide more scaling runs
Missing required parametersIncomplete paramsAdd mesh and fields to params file

Optimization Strategies by Bottleneck Type

Solver Bottlenecks

  • Use algebraic multigrid (AMG) preconditioner
  • Tighten solver tolerance if over-solving
  • Consider direct solver for small problems
  • Profile matrix assembly vs solve time

Assembly Bottlenecks

  • Cache element matrices if geometry is static
  • Use vectorized assembly routines
  • Consider matrix-free methods
  • Parallelize assembly with coloring

I/O Bottlenecks

  • Reduce output frequency
  • Use parallel I/O (HDF5, MPI-IO)
  • Write to fast scratch storage
  • Compress output data

Scaling Bottlenecks

  • Investigate communication overhead
  • Check for load imbalance
  • Reduce synchronization points
  • Use asynchronous communication
  • Consider hybrid MPI+OpenMP

Memory Bottlenecks

  • Reduce mesh resolution
  • Use iterative solver (lower memory than direct)
  • Enable out-of-core computation
  • Increase number of processors
  • Use single precision where appropriate

Limitations

  • Log parsing: Depends on pattern matching; may miss unusual formats
  • Scaling analysis: Requires at least 2 runs for meaningful results
  • Memory estimation: Approximate; actual usage may vary
  • Recommendations: General guidance; may need domain-specific tuning

References

  • references/profiling_guide.md - Profiling concepts and interpretation
  • references/optimization_strategies.md - Detailed optimization approaches

Version History

  • v1.0.0 (2025-01-22): Initial release with 4 profiling scripts

Related skills

FAQ

What does the skill consider a dominant phase?

A phase using more than 50% of runtime is flagged as poor/dominant per the threshold tables.

Does it need external dependencies?

No, it uses only the Python standard library and works on Linux, macOS, and Windows.

Debuggingmonitoringinfra

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.