Skip to content

improve performance of Type.describe() by removing regex matching#3991

Open
hduelme wants to merge 1 commit intomapstruct:mainfrom
hduelme:improve-performance-of-Type.describe()-by-removing-regex-matching
Open

improve performance of Type.describe() by removing regex matching#3991
hduelme wants to merge 1 commit intomapstruct:mainfrom
hduelme:improve-performance-of-Type.describe()-by-removing-regex-matching

Conversation

@hduelme
Copy link
Contributor

@hduelme hduelme commented Feb 3, 2026

In Type.describe(), the packageName should be removed from the beginning of the fullyQualifiedName.
The current implementation uses a regex for this, which results in a regex compilation on every call. In addition, the dots in the regex are not escaped, which could theoretically lead to overmatching (even though this should never happen).

I changed the implementation to remove the packageName if the fullyQualifiedName actually starts with it, by using substring.

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.

1 participant