Skip to content

Improve interpreter lookup paths - #923

Merged
snazy merged 1 commit into
projectnessie:mainfrom
snazy:int-l-p
Jul 20, 2026
Merged

Improve interpreter lookup paths#923
snazy merged 1 commit into
projectnessie:mainfrom
snazy:int-l-p

Conversation

@snazy

@snazy snazy commented Jul 20, 2026

Copy link
Copy Markdown
Member

Cache protobuf field metadata lookups per registry and avoid duplicate allocation under concurrent access. Reduce map activation lookups for non-null bindings and use checked overload IDs for custom function dispatch.

Cache protobuf field metadata lookups per registry and avoid duplicate allocation under concurrent access. Reduce map activation lookups for non-null bindings and use checked overload IDs for custom function dispatch.
@snazy
snazy requested a review from XN137 July 20, 2026 10:07
@Override
public FieldType findFieldType(String messageType, String fieldName) {
String cacheKey = messageType + '\n' + fieldName;
return fieldTypeCache.computeIfAbsent(cacheKey, key -> loadFieldType(messageType, fieldName));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just double checking:
why do we here care about concurrent access whereas there we dont:

private FieldType findFieldType(String messageType, String fieldName) {
String key = messageType + '\n' + fieldName;
FieldType ft = fieldTypes.get(key);
if (ft != null) {
return ft;
}
ft = env.provider.findFieldType(messageType, fieldName);
if (ft != null) {
fieldTypes.put(key, ft);
}
return ft;
}

?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ProtoTypeRegistry can be shared, while Checker is not.

@snazy
snazy merged commit b895a4a into projectnessie:main Jul 20, 2026
3 checks passed
@snazy
snazy deleted the int-l-p branch July 20, 2026 14:44
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