소스 정보
- 저장소
- KYRIE66nb/codex-omx-public-config
- 최근 소스 활동
- 2026년 5월 28일 04:35
- 감지된 SKILL.md 언어
- 영어
- 스타
- 0
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/KYRIE66nb/codex-omx-public-config --skill simulink-profiler-analyzer명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | simulink-profiler-analyzer |
| description | Analyze Simulink profiler output. |
You are an expert at analyzing Simulink Profiler data. You help users identify simulation bottlenecks in a single profiler session, or compare two sessions to pinpoint performance regressions.
Simulink.profiler.Data into structured tables (phases, block profiles, execution tree)Before any analysis, run the setup function located in the skill's scripts/ folder. This self-locating script adds its own folder to the MATLAB path regardless of where the skill is installed or which AI agent is used.
run('SCRIPTS_FOLDER/setup.m')
Replace SCRIPTS_FOLDER with the absolute path to this skill's scripts/ directory (derived from the <skill_files> entries below — use the parent folder of any listed .m file).
This makes the following functions available:
parseSimulinkProfilerData — parse Simulink.profiler.Data into structured tablesdisplayBlockHotspots — display top N block-level hotspotsdisplayExecTreeHotspots — display top N execution-tree hotspotsdrillIntoSubsystem — filter exec tree to a specific subsystemcomparePhases — compare phase-level timing between two sessionscompareBlockProfiles — compare block-level timing between two sessionscompareExecNodes — compare exec-tree nodes for a subsystem across sessionsgenerateProfilerReport — generate a self-contained HTML report with findingsUse when the user wants to profile a model that is loaded or can be loaded in MATLAB.
% Load the model if not already open
load_system('ModelName');
% Enable the profiler and simulate
set_param('ModelName', 'Profile', 'on');
simOut = sim('ModelName');
% Extract profiler data
profilerData = Simulink.profiler.Data(simOut);
After obtaining profilerData, proceed to the Analysis Workflow.
Use when the user provides a .mat file containing saved profiler results. The variable inside is typically named profilerData but may vary.
d = load('path/to/profilerData.mat');
% Inspect variable names
disp(fieldnames(d));
% Use the Simulink.profiler.Data variable (name may vary)
profilerData = d.profilerData;
If the user has a profilerData variable already in the MATLAB workspace, use it directly.
The user may state that a variable like profilerData already exists in the workspace. Verify with whos profilerData and use it directly.
results = parseSimulinkProfilerData(profilerData);
This returns a struct with:
results.modelName — run identifier stringresults.totalSimTime — total wall-clock time in secondsresults.phases — table of top-level phases (compile, init, simulation, termination)results.blockProfiles — table of per-block timing from the UI node treeresults.execTree — table of all execution nodes flattened from the exec treeDisplay the phases table to understand where time is spent at the highest level:
fprintf('Model: %s\nTotal time: %.2f s\n\n', results.modelName, results.totalSimTime);
disp(results.phases);
Report which phase dominates (compile, simulation, initialization, or termination).
displayBlockHotspots(results.blockProfiles); % top 20 by default
displayBlockHotspots(results.blockProfiles, 10); % or specify N
Identify blocks with high SelfTime_s — these are the actual compute bottlenecks. Blocks with high TotalTime_s but low SelfTime_s are containers whose children consume the time.
displayExecTreeHotspots(results.execTree); % top 20 by default
displayExecTreeHotspots(results.execTree, 10); % or specify N
This also shows per-call cost (selfTime / numberOfCalls) for each node.
Key execution methods to watch for:
ModelReference.Outputs.Major — model reference output computation per stepStateflowChild.Outputs.Major — Stateflow / MATLAB Function block executionScope.SetupRunTimeResources — scope initialization overheadS-Function.SetupRunTimeResources — S-function initializationDataStoreRead.Outputs.Major — data store access overhead.Update — block state update costWhen a subsystem or model reference is identified as slow, use:
drillIntoSubsystem(results.execTree, "SubsystemName");
drillIntoSubsystem(results.execTree, "SubsystemName", 0.01); % custom threshold
Adjust the self-time threshold based on the model's total time. For large models, use a higher threshold.
Summarize the findings in a structured format:
Generate a self-contained HTML report with all profiling data plus the findings and recommendations from Step 6. Build the findings string using Markdown-style formatting, then call generateProfilerReport:
findings = sprintf([ ...
'## Key Findings\n' ...
'- Simulation phase dominates at 95%% of total time\n' ...
'- Scope blocks consume 2.3 s of init time\n' ...
'\n' ...
'## Recommendations\n' ...
'- Disable or close all Scope blocks for batch runs\n' ...
'- Switch model references to Accelerator mode\n']);
generateProfilerReport(results, findings);
generateProfilerReport(results, findings, 'MyReport.html'); % custom output path
The report includes:
When comparing two profiler sessions (e.g., different releases, before/after a change):
r1 = parseSimulinkProfilerData(profilerData1);
r2 = parseSimulinkProfilerData(profilerData2);
comparePhases(r1, r2); % default labels
comparePhases(r1, r2, "R2023b", "R2025b"); % custom labels
comparePhases(r1, r2, "Before", "After"); % or any labels
compareBlockProfiles(r1, r2); % top 20, default labels
compareBlockProfiles(r1, r2, 10, "Before", "After"); % top 10, custom labels
When a specific subsystem is identified as regressed, compare its internal exec nodes:
compareExecNodes(r1, r2, "SubsystemName");
compareExecNodes(r1, r2, "SubsystemName", 0.01, "R2023b", "R2025b");
Summarize:
ModelReference.Outputs.Major entry with selfTime == totalTime. No internal detail is visible. A high self time here indicates overhead in the accelerated model reference execution engine, not in any specific block.mdlStart.Always compute per-call cost when comparing: selfTime / numberOfCalls. A block may have high total time simply because it is called many times (e.g., in a triggered or enabled subsystem). The displayExecTreeHotspots and drillIntoSubsystem functions include per-call cost automatically.
parseSimulinkProfilerData to parse data — never manually traverse the tree.fprintf loops.SelfTime_s descending to find actual compute bottlenecks, or by TotalTime_s descending to find the most time-consuming subtrees.