Expand description
cu-profiler-core — the Solana compute-intelligence engine.
This crate owns the domain model, the Solana log parser, the CPI call-tree
and scope-marker analysis, the budget policy engine, baselines, confidence
scoring, and diagnostics. It depends on no CLI code and no live Solana
runtime by default: the backend::RecordedLogsBackend drives the entire
pipeline from logs, which is how the parser, reports and CI logic are
developed and tested.
§Honesty about limitations
- Scope/function attribution requires explicit markers; there is no automatic source-line profiling.
program-testresults may differ from mainnet runtime conditions.- Baselines are only valid when their
baseline::Fingerprintmatches.
§Example
use cu_profiler_core::backend::RecordedLogsBackend;
use cu_profiler_core::metadata::RunMetadata;
use cu_profiler_core::scenario::Scenario;
use cu_profiler_core::Profiler;
let mut backend = RecordedLogsBackend::new();
backend.insert_blob(
"swap",
"Program P invoke [1]\nProgram P consumed 1000 of 200000 compute units\nProgram P success",
true,
);
let report = Profiler::new().run(
&backend,
&[Scenario::new("swap")],
None,
RunMetadata::recorded(cu_profiler_core::VERSION),
);
assert_eq!(report.scenarios[0].measurement.total_cu, 1000);Re-exports§
Modules§
- backend
- Execution backends.
- baseline
- Baseline records and their on-disk store.
- budget
- Budget policy engine.
- confidence
- Confidence scoring.
- config
cu-profiler.tomlparsing.- diagnostics
- Diagnostic engine: turns analysed data into actionable, Solana-specific findings.
- error
- Typed error model for
cu-profiler-core. - metadata
- Run-level metadata attached to every report and baseline record.
- model
- The report data model: the raw, serializable result of a profiling run.
- parser
- Solana log parsing: lexer, compute-budget heuristics, CPI tree, and scope
markers, plus a
analyzefacade that turns raw logs into a structuredParseAnalysisthe profiler can consume. - profiler
- The profiler engine: runs scenarios through a backend, parses the logs, and
assembles a
Report— applying budget policies, baseline comparison, confidence scoring and diagnostics along the way. - program_
registry - Registry mapping program IDs (base-58 pubkeys) to human labels.
- scenario
- The first-class
Scenariotype.
Constants§
- VERSION
- The version of
cu-profiler-core.