[GH-ISSUE #178] application: pre-index artifact occurrences to avoid repeated linear searches #126

Closed
opened 2026-10-15 18:21:21 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @morluto on GitHub (Jul 14, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/178

Problem

Artifact graph inventory and edge construction perform repeated linear scans inside loops.

Evidence

  • src/application/ArtifactInventory.ts:183-187 maps each pendingContradiction via occurrences.find(...).
  • src/application/ArtifactGraphConstruction.ts:206-210 resolves source occurrences via occurrences.find(...) for each non-root occurrence.

Impact

This introduces O(n²) behavior and can degrade scan speed for large archives with many files and occurrences.

Ask

Build temporary lookup maps (e.g., by logical path / by occurrence id) once, then replace repeated .find scans with constant-time lookups.

Originally created by @morluto on GitHub (Jul 14, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/178 ### Problem Artifact graph inventory and edge construction perform repeated linear scans inside loops. ### Evidence - `src/application/ArtifactInventory.ts:183-187` maps each `pendingContradiction` via `occurrences.find(...)`. - `src/application/ArtifactGraphConstruction.ts:206-210` resolves source occurrences via `occurrences.find(...)` for each non-root occurrence. ### Impact This introduces O(n²) behavior and can degrade scan speed for large archives with many files and occurrences. ### Ask Build temporary lookup maps (e.g., by logical path / by occurrence id) once, then replace repeated `.find` scans with constant-time lookups.
bsakaguchi 2026-10-15 18:21:21 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#126
No description provided.