compile-analysis_skill

This skill analyzes compilation efficiency for a given source file, reporting compile time, memory usage, and header dependency tree to optimize builds.
  • Python

0

GitHub Stars

2

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill openharmonyinsight/openharmony-skills --skill compile-analysis

  • README.md19.3 KB
  • SKILL.md18.9 KB

Overview

This skill analyzes compilation efficiency for individual source files in the ace_engine project. It measures compile time, peak memory, and builds header dependency trees, and can generate reusable standalone compilation scripts. Results are produced by running the project-provided scripts and saved into the out/{product} directory for repeatable benchmarking.

How this skill works

The skill extracts the exact compilation command from ninja metadata, instruments it for timing and memory profiling, and optionally saves an enhanced standalone script under out/{product}/compile_single_file_{name}.sh. It executes the instrumented command inside out/{product}, generates a preprocessed .ii file, and parses that .ii with the built-in parse_ii.py to produce a hierarchical header dependency tree. All outputs are based on actual execution; dependency parsing always uses parse_ii.py.

When to use it

  • Investigating unusually slow compilation times for a single file
  • Counting or visualizing header dependencies for a source file
  • Generating a repeatable script for benchmarking a file’s compile cost
  • Isolating and compiling a file in out/{product} for debugging
  • Extracting and saving the exact compile command for reproducibility

Best practices

  • Always run analysis from the ace_engine project root so scripts locate the OpenHarmony root correctly
  • Execute extracted/enhanced scripts from out/{product} — not the project root
  • Use --save-script or --save-enhanced to produce reusable scripts for repeated measurements
  • Rely on parse_ii.py to analyze .ii files; do not substitute other preprocessing methods
  • Record elapsed time and peak memory across multiple runs to spot variance and caching effects

Example use cases

  • Analyze frame_node.cpp compilation: generate .ii, parse headers, save dependency tree to out/rk3568/frame_node_dependency_tree.txt
  • Save a reusable benchmarking script: analyze_compile.sh frameworks/.../file.cpp rk3568 --save-script → out/rk3568/compile_single_file_file.sh
  • Compile a single file in isolation: if script exists, cd out/rk3568 && bash compile_single_file_name.sh to get time, peak memory, and .o/.ii outputs
  • Extract the raw and enhanced compile commands without executing using get_compile_command.py -- useful to inspect flags and include paths
  • When .ii is missing: generate the compile script, run it to create the .ii, then parse with parse_ii.py and save the dependency tree

FAQ

Yes. Extracted/enhanced scripts must be executed inside out/{product}; running elsewhere can break paths and produce incorrect outputs.

Can I use other tools to parse dependencies?

No. Dependency trees must be produced by parsing .ii files with parse_ii.py as provided; other methods are not allowed.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational