WerWolv / ImHex

🔍 A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.
https://imhex.werwolv.net
GNU General Public License v2.0
43.98k stars 1.92k forks source link

[Bug] Diffing is extremely slow #1631

Closed FireNX70 closed 4 months ago

FireNX70 commented 5 months ago

Operating System

Linux

What's the issue you encountered?

On recent nightlies, diffing takes an absurd amount of time. As an example; diffing two 600MB files takes about 5.5 seconds on 1.33.2, but on the latest nightly it hadn't even made it halfway after 15 minutes.

How can the issue be reproduced?

Just diff two files. It might be slow enough to be noticeable even on small files.

ImHex Version

1.33.0 (e9ebfe3)

ImHex Build Type

Installation type

AppImage

Additional context?

This was already like this on nightlies from a couple of days ago (I think I was using 0bd8c5d), but it might have already been broken before that.

Whether the files are opened in read-only mode doesn't seem to have an effect (or if it does it's minimal).

xosview shows it's pinning one of the threads to 100%, mostly with a "SYS" workload (a.k.a. kernel-mode stuff). On 1.33.2, it shows up as a mostly user-mode load; which is what I would expect.

FireNX70 commented 5 months ago

Just tested it on Windows 10. It seems just as slow, but I'm not gonna let it sit for another 15 minutes.

FireNX70 commented 5 months ago

I've tracked this down to a449f7a, so technically it's a bug in libwolv and not ImHex. That commit looks completely reasonable so I'm not sure why it causes such severe slowdown.

FireNX70 commented 4 months ago

Fixed by 5bc60d4.