• Witold Baryluk's avatar
    ntdll: Speed up NtQueryVirtualMemory(MemoryWorkingSetExInformation) by conditional page check. · ee706c3e
    Witold Baryluk authored
    Legends game periodically (every 30 seconds) calls this function
    with up to 22k virtual addresses. All but 1 of them is valid. Due to
    amount of queries addresses, and cost of seek+read, this causes this
    function to take up to about 50ms. So framerate drops from ~150 FPS to
    20FPS for about a second.
    
    As far as I can see, returning 0 entries from this function, still makes
    Apex Legend work.
    
    But keep code correct, and optimise it by only performing pagemap read
    when the address is valid.
    
    This change get_working_set_ex reduces peek wall clock runtime from 57ms
    to 0.29ms.
    
    Tested on Linux, but similar change done for the BSD part.
    Signed-off-by: 's avatarWitold Baryluk <witold.baryluk@gmail.com>
    ee706c3e
Name
Last commit
Last update
dlls Loading commit data...
documentation Loading commit data...
fonts Loading commit data...
include Loading commit data...
libs Loading commit data...
loader Loading commit data...
nls Loading commit data...
po Loading commit data...
programs Loading commit data...
server Loading commit data...
tools Loading commit data...
.editorconfig Loading commit data...
.gitlab-ci.yml Loading commit data...
.mailmap Loading commit data...
ANNOUNCE Loading commit data...
AUTHORS Loading commit data...
COPYING.LIB Loading commit data...
LICENSE Loading commit data...
LICENSE.OLD Loading commit data...
MAINTAINERS Loading commit data...
README Loading commit data...
VERSION Loading commit data...
aclocal.m4 Loading commit data...
configure Loading commit data...
configure.ac Loading commit data...