Performance Hit with Scans on Fragmented Results
zcanann opened this issue · comments
It turns out that the trade-off of grouping ReadProcessMemory WinAPI calls but wasting memory is significant.
ex) If we had a page of virtual memory that was 256 MB, and scan results of type Int32 (so 4B of memory) spaced 8 MB apart (for a grand total of 32 results), doing 32 ReadProcessMemory calls is much worse performance wise than doing 1 ReadProcessMemory call and wasting 255.8MB of memory (32 * 4B = 128B).
It seems counter-intuitive to literally waste 255.8MB of memory (99.92% of the returned memory), but performance wise it's way better.
Some sort of smart grouping is going to be needed in the ValueCollector eventually™