Squalr / Squalr

Squalr Memory Editor - Game Hacking Tool Written in C#

Home Page:https://www.squalr.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Performance Hit on Scanning Large Contiguous Regions

zcanann opened this issue · comments

Scans are parallelized at the region level, so a large region can end up running alone after all other threads have finished scanning the other regions. It turns out that this can be quite significant.

Likely, this comes from scanning modules, as these tend to be one contiguous block of memory (which can be several hundred MB)

This project was architected to avoid the region-boundary issue (ie an Int32 being split across two adjacent regions) by merging adjacent regions. For this reason, I do not want to introduce region chunking, as it brings back the problem I have been carefully avoiding this whole time.

The way to solve this will likely be some sort of "Virtual Region", which serves as a window into a much larger region. This has the benefits of chunking, while avoiding the problem mentioned above.

Another solution is a greedy algorithm that begins scanning large regions first. This will likely help a little bit, but is not a real solution.