You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The usage of String.Split to extract segments from the token is expensive as it creates new strings and leads to additional memory allocation.
Describe the solution you'd like
Introduce a JsonWebToken Constructor that accepts ReadOnlyMemory representation of the encodedToken. This would allow us to substitute string.Split with span.Slice which will avoid string creation.
Update existing constructors to call into ReadTokens(ReadOnlyMemory) to maintain a single code path and enable current implementations to take advantage of some of the improvements without making any changes.
The text was updated successfully, but these errors were encountered:
Added benchmarks in the PR that I just linked to the GitHub issue and in the discussion board where a preview has been shared. Appreciate any feedback.
Is your feature request related to a problem? Please describe.
The usage of String.Split to extract segments from the token is expensive as it creates new strings and leads to additional memory allocation.
Describe the solution you'd like
The text was updated successfully, but these errors were encountered: