Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mmap for filesystem compiled contract cache #10807

Open
nagisa opened this issue Mar 15, 2024 · 0 comments
Open

mmap for filesystem compiled contract cache #10807

nagisa opened this issue Mar 15, 2024 · 0 comments
Assignees
Labels
A-contract-runtime Area: contract compilation and execution, virtual machines, etc T-contract-runtime Team: issues relevant to the contract runtime team

Comments

@nagisa
Copy link
Collaborator

nagisa commented Mar 15, 2024

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, the read(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.

@nagisa nagisa added A-contract-runtime Area: contract compilation and execution, virtual machines, etc T-contract-runtime Team: issues relevant to the contract runtime team labels Mar 15, 2024
@mooori mooori self-assigned this Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contract-runtime Area: contract compilation and execution, virtual machines, etc T-contract-runtime Team: issues relevant to the contract runtime team
Projects
None yet
Development

No branches or pull requests

2 participants