Skip to content

DocLineComparator performance issue #2575

@mehmet-karaman

Description

@mehmet-karaman

Hello,

I identified a performance issue in the CompareEditor that occurs when comparing files with many similar lines. This typically affects files where most lines start identically but differ only toward the end, such as configuration files containing workspace-specific paths.

In these cases, the comparison currently spends a lot of time checking entire lines character by character, even though many differences could be detected much earlier. A simple preliminary check—verifying whether the first and last characters of a line match—can already rule out many unnecessary full comparisons.

I applied this optimization in the DocLineComparator, which significantly reduces the amount of work needed during comparison. For the affected scenarios, this change improves performance by approximately 80–90%.

I would like to provide a PR for this. Thanks in advance.

Best regards
Mehmet Karaman

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions