Skip to content

query: answer mid-edit at once, and index the no-caller lookups - #1864

Merged
swapnilpaliwal-sd merged 1 commit into
apps/integration-0.1.9from
perf/query-speed
Oct 8, 2026
Merged

swapnilpaliwal-sd merged 1 commit into
apps/integration-0.1.9from
perf/query-speed

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor

Symptoms

  1. A query whose answer touched a file edited since the graph was built waited up to AXIOMCODE_FRESH_WAIT (default 30 s) for the background rebuild. Replaying an agent's edits on a 1,300-file Java repository, every query about the code being edited took 20–33 s, although the answer from the previous graph already marks the rows in edited files and names the files it predates.
  2. On a fresh graph, impact took 1.8 s, 1.2 s of it in no_caller_reasons → library_bases / type_parts, which read type_refs by file + line and symbols by qualified name, neither of them indexed (65k-row scans per type).

Change

  • AXIOMCODE_FRESH_WAIT defaults to 0: the query answers from the previous graph at once, with its graph refresh: line and marked rows. --fresh (MCP fresh=true) still waits; setting the variable restores a wait.
  • axiomcode-index adds type_refs(file, line) and symbols(qualified_name).

Evidence (1,300-file Java repository)

Before After
Query touching an edited file, mid-edit 28.5 s 0.83 s, 5 rows marked "(may be out of date)"
impact, five targets, fresh graph 0.68–1.75 s 0.49–0.72 s
Answers on those five targets byte-identical with and without the indexes
Graph size +4% (9 MB)
  • tests/freshness.py: 118 of 118 pass.
  • tests/refresh.py --lang java: the same 8 changed-reporting failures as on the unmodified integration branch, none new.

Not in this PR

  • The first query after a rebuild still pays the impact export (4–6 s) when it races the background warm-up (1.2 s once it finishes). Warming the new graph before it is published needs a facts cache per graph version: today one out/dl/impact is stamped with the live graph's mtime, so warming the next graph early would invalidate the one being read.
  • README still says the wait defaults to 10 s; its update is held back because the README trips the pre-commit term check on existing content.

A query whose answer touched a file edited since the graph was built waited up to
AXIOMCODE_FRESH_WAIT (default 30 s) for the background rebuild. On a 1,300-file Java
repository an agent asking about the code it was editing waited 20-33 s per query,
though the answer from the previous graph already marks those rows and names the
files it predates. The default is now 0: answer at once; --fresh still waits.

impact spent 1.2 s of 1.8 s finding why a method has no callers: the bases written
in a type's header were read from type_refs by file and line, and a partial type's
parts from symbols by qualified name, neither indexed. Two indexes take impact to
0.5-0.75 s with byte-identical answers on five targets; the graph grows 4%.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
@swapnilpaliwal-sd swapnilpaliwal-sd self-assigned this Oct 8, 2026
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit b5d6d73 into apps/integration-0.1.9 Oct 8, 2026
12 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the perf/query-speed branch October 8, 2026 17:00
swapnilpaliwal-sd added a commit that referenced this pull request Oct 8, 2026
Node ≥ 22.13 in the badge and Requirements (#1865). The refresh paragraph still said a
query waits up to AXIOMCODE_FRESH_WAIT (default 10) seconds; since #1864 it answers from
the previous graph at once, with the rows in edited files marked, and --fresh waits.

Committed with --no-verify (approved for this PR): the term check matches content
already in README.md, none of it in these lines.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
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