Lag Detector
by scawful
Performance profiler for Oracle of Secrets. Samples the CPU Program Counter (PC) to identify code hotspots and laggy routines using statistical analysis.
Skill Details
Repository Files
1 file in this skill directory
name: lag-detector description: Performance profiler for Oracle of Secrets. Samples the CPU Program Counter (PC) to identify code hotspots and laggy routines using statistical analysis.
Lag Detector
Scope
- Profiling: Statistical sampling of CPU execution.
- Hotspot Analysis: Identify which routines consume the most cycles.
- Source Mapping: Map hotspots back to ASM files.
Core Capabilities
1. Profile execution
run --duration 10: Sample CPU for 10 seconds.- Output: A heatmap of the most executed routines.
2. Identify Bottlenecks
- "Routine
Update_Spritesexecuted 5000 times (40% of samples)." - Helps pinpoint inefficient loops or heavy logic.
Workflow
- Setup: Navigate to a laggy area (e.g., room with many enemies).
- Profile:
lag-detector run --duration 5. - Analyze: "Top hotspot is
Sprite_DrawinSprites.asm."
Dependencies
- Tool:
~/src/hobby/yaze/scripts/ai/profiler.py. - Mesen2: Running with socket server.
- z3ed: For symbol resolution.
Example Prompts
- "Profile the game for 10 seconds to find lag sources."
- "What routine is taking up the most CPU time right now?"
Troubleshooting
- No Hotspots: Ensure the game is not paused.
- Unknown Symbols: Ensure the ROM has a valid
.mlborsourcemap.json.
Related Skills
Mermaid Diagrams
Comprehensive guide for creating software diagrams using Mermaid syntax. Use when users need to create, visualize, or document software through diagrams including class diagrams (domain modeling, object-oriented design), sequence diagrams (application flows, API interactions, code execution), flowcharts (processes, algorithms, user journeys), entity relationship diagrams (database schemas), C4 architecture diagrams (system context, containers, components), state diagrams, git graphs, pie charts,
Matlab
MATLAB and GNU Octave numerical computing for matrix operations, data analysis, visualization, and scientific computing. Use when writing MATLAB/Octave scripts for linear algebra, signal processing, image processing, differential equations, optimization, statistics, or creating scientific visualizations. Also use when the user needs help with MATLAB syntax, functions, or wants to convert between MATLAB and Python code. Scripts can be executed with MATLAB or the open-source GNU Octave interpreter
Dask
Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed use polars.
Consult Zai
Compare z.ai GLM 4.7 and code-searcher responses for comprehensive dual-AI code analysis. Use when you need multiple AI perspectives on code questions.
Writing Effective Prompts
Structure Claude prompts for clarity and better results using roles, explicit instructions, context, positive framing, and strategic organization. Use when crafting prompts for complex tasks, long documents, tool workflows, or code generation.
Analyze Performance
Establish performance baselines and detect regressions using flamegraph analysis. Use when optimizing performance-critical code, investigating performance issues, or before creating commits with performance-sensitive changes.
Flowchart Creator
Create HTML flowcharts and process diagrams with decision trees, color-coded stages, arrows, and swimlanes. Use when users request flowcharts, process diagrams, workflow visualizations, or decision trees.
Bio Reporting Rmarkdown Reports
Create reproducible bioinformatics analysis reports with R Markdown including code, results, and visualizations in HTML, PDF, or Word format. Use when generating analysis reports with RMarkdown.
Desmos Graphing
Create interactive Desmos graphs in Obsidian using desmos-graph code blocks. Use when visualizing functions, parametric curves, inequalities, or mathematical relationships with customizable styling and settings.
Performance
Rendimiento & Optimización - Atoll Tourisme. Use when optimizing performance or profiling code.
