Skip to content

Compile the engine binaries at build time, not at the first index - #1831

Merged
swapnilpaliwal-sd merged 1 commit into
apps/integration-0.1.9from
apps/javascript/cold-datalog-compile-dominates-first-ind
Sep 30, 2026
Merged

swapnilpaliwal-sd merged 1 commit into
apps/integration-0.1.9from
apps/javascript/cold-datalog-compile-dominates-first-ind

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor

On a cold cache, the first index compiled the language's engine with the C++ compiler. That took minutes whatever the repository's size; the index itself takes seconds.

  • run-souffle.sh --prepare: makes one language's engine binary ready (packaged, cached or compiled) without a project. It uses the same program text, engine id, cache entry and compile lock as a run, so an index that starts while a compile runs waits for it and does not compile a second time.
  • bin/axiomcode prepare [--language …] [--background]: prepares every language in parallel.
  • postbuild starts it in the background, so an install or refresh compiles the engines before the first index. CI or AXIOMCODE_NO_PREPARE skips it.
  • engine-package-test.sh gets cases for prepare, then a second prepare with no recompile, then a run that reuses the prepared binary. The control: a background prepare under CI compiles nothing. The new cases fail on the old script (6 failures).

Checked on a 3-file JS repo with a cold cache: first index went from 315 s to 3 s after prepare (5 engines prepared in parallel in 422 s at build time). JS suite 88/88. Engine-id, engine-package, souffle-include and bundle tool tests ok. On the product, edges are 11309 → 11309 and probes 57/70 → 57/70.

On a cold cache the first index compiled the language's engine with the C++
compiler: minutes regardless of repository size, while the index itself takes
seconds. run-souffle.sh gains --prepare (the same program, id, cache entry and
lock as a run, without a project), bin/axiomcode gains `prepare` (every
language in parallel), and npm's postbuild starts it in the background, so an
install or a refresh compiles the engines before the first index needs them.
Skipped under CI or AXIOMCODE_NO_PREPARE.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit e72b84f into apps/integration-0.1.9 Sep 30, 2026
12 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the apps/javascript/cold-datalog-compile-dominates-first-ind branch September 30, 2026 16:57
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