Skip to content

#404 Batch transaction for index_project #406

Closed

Description

@ajianaz

Problem

index_project uses per-file transactions. Each file = 1 DELETE + N INSERT + COMMIT. 100 files = 100 fsync operations.

Location

src/index/mod.rs:222-258 -- for entry in walker { index_file() } calls conn.unchecked_transaction() per file.

Solution

Wrap the entire indexing loop in a single transaction. Use conn.unchecked_transaction() around the full index_project_with_id function body, and remove per-file transactions from index_file().

Expected Impact

2-3x faster indexing (eliminates ~100 fsyncs per project).

Benchmark Baseline

Repo Current
cora-code (98 files) 2.31s
cora (550 files) 13.4s
JS (600K LOC) 27.2s

Activity

  1. added
    performance
    phase-1
    on Jul 28, 2026
  2. ajianaz commented on Jul 28, 2026

    @ajianaz
    CollaboratorAuthor

    Resolved by PR #421. PRAGMA journal_mode=WAL, synchronous=NORMAL, cache_size=-64000 applied during indexing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancephase-1priority:high

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions