Skip to content

chore: add Codescythe stage profiling#56

Merged
longlho merged 1 commit into
mainfrom
codex/stage-profile
May 22, 2026
Merged

chore: add Codescythe stage profiling#56
longlho merged 1 commit into
mainfrom
codex/stage-profile

Conversation

@longlho
Copy link
Copy Markdown
Contributor

@longlho longlho commented May 22, 2026

Summary

  • add opt-in profiling Cargo features for the core crate and CLI
  • add //crates/codescythe_cli:codescythe_profiling as the Bazel profiling binary
  • compile profiler timers, counters, and resolver hot-path branches out of the default binary
  • keep CODESCYTHE_PROFILE=1 profile output on stderr for profiling builds
  • document the current Kibana profiling findings and optimization priorities in ARCHITECTURE.md

Kibana Profile

Representative optimized run with the vendored Kibana fixture using //crates/codescythe_cli:codescythe_profiling:

  • total: 12.18s
  • project discovery: 1.18s
  • reachable graph walk: 10.41s
  • graph frontier parse: 4.03s
  • graph frontier inspect: 6.38s
  • issue map construction: 81ms
  • JSON serialization: 12.9ms
  • resolver calls: 1,715,145
  • resolver cache hit rate: 75.9%
  • uncached resolver time: 4.77s

The profiling run produced JSON output byte-for-byte identical to the baseline output.

Validation

  • cargo fmt --check
  • git diff --check
  • bazel build -c opt //crates/codescythe_cli:codescythe
  • bazel build -c opt //crates/codescythe_cli:codescythe_profiling
  • binary string scan: default binary has no CODESCYTHE_PROFILE / profile output strings; profiling binary does
  • cmp -s /private/tmp/kibana-baseline-output.json /private/tmp/kibana-stage-profile-feature-opt-output.json
  • bazel test //crates/codescythe:codescythe_test //crates/codescythe_cli:codescythe_cli_test //crates/codescythe_cli:codescythe_cli_e2e_test //benchmarks:kibana_fixture_test

@longlho longlho force-pushed the codex/stage-profile branch from 86691b5 to 6509fa1 Compare May 22, 2026 16:31
@longlho longlho force-pushed the codex/stage-profile branch from 6509fa1 to 462e979 Compare May 22, 2026 16:33
@longlho longlho merged commit b396f25 into main May 22, 2026
1 check passed
@longlho longlho deleted the codex/stage-profile branch May 22, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant