Skip to content

perf: native Rust build-glue queries (detect-changes, finalize, incremental) #694

@carlos-alm

Description

@carlos-alm

Summary

Move the ~46 db.prepare() calls in domain/graph/builder/stages/ (detect-changes, finalize, incremental, build-structure, collect-files) to dedicated Rust methods on NativeDatabase.

These are the "glue" queries around the native hot path — file hash checks, count queries, advisory checks. Individually cheap (1-5ms) but they add up to ~50-100ms of JS↔SQLite overhead on a full rebuild.

What to do

  • Batch detect-changes hash queries into a single Rust method
  • Move finalize count/advisory queries to Rust
  • Move incremental hash comparison to Rust
  • Goal: reduce ~46 small JS↔SQLite round-trips to 3-5 batched Rust calls

Impact

~20% of remaining native performance gap on builds. Moderate effort.

Metadata

Metadata

Assignees

No one assigned

    Labels

    follow-upDeferred work from PR reviews that needs tracking

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions