[Comgr] Serve repeat metadata queries from a per-DataObject cache - #3840
Open
chinmaydd wants to merge 1 commit into
Open
[Comgr] Serve repeat metadata queries from a per-DataObject cache#3840chinmaydd wants to merge 1 commit into
chinmaydd wants to merge 1 commit into
Conversation
This was referenced Aug 10, 2026
amd_comgr_get_data_metadata re-parsed the ELF and every AMDGPU note on every call. Reuse the parsed MetaDocument via the shared_ptr that DataMeta already holds, so N queries on one code object cost one parse. Cache population is serialized because these query entry points used to be read-only with respect to the DataObject. setData(unique_ptr<MemoryBuffer>) now routes through clearData(), which also fixes it never freeing a previously setCStr-allocated Data. 500000 repeat queries on shared-v3.so: 4809 ms -> 17 ms. Co-authored-by: Cursor <cursoragent@cursor.com>
chinmaydd
force-pushed
the
amd/dev/chdeshpa/comgr-metadata-cache
branch
from
August 10, 2026 17:50
1c1483a to
ad67e0f
Compare
chinmaydd
marked this pull request as ready for review
August 10, 2026 18:22
Author
|
!PSDB |
jmmartinez
reviewed
Aug 11, 2026
jmmartinez
left a comment
There was a problem hiding this comment.
Looks good to me, but I'm not super familiar with this part of the API.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is first in a series of PRs that aim to improve Comgr.
amd_comgr_get_data_metadatare-parsed the ELF and every AMDGPU note on every call. Reuse the parsed MetaDocument via the shared_ptr that DataMeta already holds, so N queries on one code object cost one parse. Cache population is serialized because these query entry points used to be read-only with respect to the DataObject.setData(unique_ptr<MemoryBuffer>)now routes throughclearData(), which also fixes it never freeing a previously setCStr-allocated Data.500000 repeat queries on shared-v3.so: 4809 ms -> 17 ms.
[1/3] <- you are here
[2/3] <- #3841
[3/3] <- #3842