Skip to content

diff: fix poor performance #225

@andrewliebenow

Description

@andrewliebenow

Is your feature request related to a problem? Please describe.
diff appears to process files multiple orders of magnitude slower than other implementations:

❯ time -- diff -- ./file-a ./file-b
Elapsed time: 3.381272 seconds
User time: 0.000000 seconds
System time: 0.000000 seconds

❯ time -- diffutils -- ./file-a ./file-b
Elapsed time: 0.005884 seconds
User time: 0.000000 seconds
System time: 0.000000 seconds

❯ du -k -- ./file-a ./file-b
1384    ./file-a
1384    ./file-b

In this case, file-a and file-b are identical.

Describe the solution you'd like
I think we should aim for diff to be able to process files at 10 mebibytes per second, at the very least (on my system, the current implementation is getting less than 0.5 mebibytes per second). On my system, diffutils from uutils does over 200 mebibytes per second.

Describe alternatives you've considered
N/A

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions