mmap for filesystem compiled contract cache #10807
Labels
A-contract-runtime
Area: contract compilation and execution, virtual machines, etc
T-contract-runtime
Team: issues relevant to the contract runtime team
The Compiled Contract Cache introduced in #10791 is reading files off disk using the plain old
read(2)
call. Although the profile looks much better than with the RocksDB-based cache, theread(2)
is very prominent in the profile.For the most part, these files should be pretty warm in the page cache, and we don't actually need the ownership of these bytes in order to load the contract. Thus using a
mmap
to put a view of this file into the memory space our our process might end up quite a bit faster than what we are currently doing (which is at least one big copy of the file contents, possibly from the file cache where the file already might be present at.)mmap also fits the bill pretty well because we will usually need the whole thing and won't be doing "random" accesses to small parts of the executable.
The text was updated successfully, but these errors were encountered: