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

Instantiate exception only when required #198

Merged
merged 1 commit into from
Aug 29, 2017

Conversation

rumdidumdum
Copy link
Contributor

The convertFromJSON() method in the JWTParser class instantiates an exception (which is accompanied by an invocation of the somewhat expensive String.format() method) for every JSON string to be converted. This occurs even if the given JSON string is valid and the exception will never be thrown. As the convertFromJSON() method is invoked twice for every token verification this PR proposes to only instantiate an exception if the JSON string is invalid, hence requiring the exception to actually be thrown.

@lbalmaceda lbalmaceda self-requested a review August 29, 2017 13:29
Copy link
Contributor

@lbalmaceda lbalmaceda left a comment

Choose a reason for hiding this comment

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

Thank you!

@lbalmaceda lbalmaceda added this to the v3-Next milestone Aug 29, 2017
@lbalmaceda lbalmaceda merged commit ba902e9 into auth0:master Aug 29, 2017
@rumdidumdum rumdidumdum deleted the improve-performance branch August 30, 2017 07:08
@lbalmaceda lbalmaceda modified the milestones: v3-Next, 3.3.0 Nov 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants