Skip to content

perf: Replace sort-based dedup with HashSet in OrJoin branch evaluation #140

Closed

Description

@adityamukho

Problem

In src/query/datalog/executor.rs:1376-1378, OrJoin uses the same sort-based deduplication pattern as Or clauses.

Time complexity: O(n log n) for sorting, identical to Issue #3.

Analysis

This is the same pattern as apply_or_clauses for Or branches, just in the OrJoin path. The fix should be consistent across both.

Fix Approach

Apply the same fix as Issue #3. Consider extracting a helper function for the deduplication logic to avoid code duplication.

Files to Modify

  • src/query/datalog/executor.rs (lines 1352-1384)

Expected Impact

Consistent O(n log n) → O(n) improvement in OrJoin branch deduplication.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions