Skip to content

high memory usage and slow ux when hunking over repo with lots of new files/changes #405

@pkieltyka

Description

@pkieltyka

What happened?

I was using hunk tool to diff my branch against master when I experienced a very strange and slow-to-respond UX. I'm on a thinkpad laptop on linux, of course any hardware should be sufficient. Running hunk 0.15.0 and bun 1.3.13. Memory usage in my usage under the condition described below went to 2GB.

Steps to reproduce

To reproduce:

  1. create a new folder in your repo, .cache/ and create 2000 small .json files in the folder.
  2. Run hunk diff on it

Yes, its a silly example and my fix was to add the .cache to .gitignore as I wasn't intending to commit it to git anyways, but it was interesting to see the strain on hunk tool in this case. Once the folder was in .gitignore, hunk performed normally as expected. The above is just a stress test example, but it is possible to have 2000 files change in a huge branch in some instances, probably too much for a human to review in some cases, but still I felt worth reporting the issue.

thanks for the great project/work.

Expected behavior

No response

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions