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

[SharedCache] Make it faster to look up which image contains an address #6437

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

bdash
Copy link
Contributor

@bdash bdash commented Feb 20, 2025

MemoryRegion now tracks the start address of the image to which it belongs. SharedCache::HeaderForAddress uses the existing address range map to quickly find the MemoryRegion for a given address, and from there can cheaply look up the image via its start address.

Some extra logic is added to CacheInfo::Load to populate the image start address on MemoryRegion when loading from metadata that predates this change.

This eliminates HeaderForAddress as a bottleneck within FindSymbolAtAddrAndApplyToAddr.

`MemoryRegion` now tracks the start address of the image to which it
belongs. `SharedCache::HeaderForAddress` uses the existing address range
map to quickly find the `MemoryRegion` for a given address, and from
there can look up the image via its start address.

Some extra logic is added to `CacheInfo::Load` to populate the image
start address on `MemoryRegion` when loading from metadata that predates
this change.

The result is that `HeaderForAddress` is no longer the most expensive
part of `FindSymbolAtAddrAndApplyToAddr`.
@emesare emesare self-assigned this Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants