- edited description
how to improve performance while parsing tokens
Hi, We are using JwtConsumer to parse JWT in our application. But we are facing performance issues in our application when there are multiple requests. I tried using JsonWebSignature also so that there will be no expiry date validation but still there was no improvement. Please find below code snippet and let me know if there is any way to improve performance
Comments (6)
-
reporter -
reporter - edited description
-
repo owner Most of the processing is likely consumed by the signature validation on the token. Things like expiry date validation and other claims validation should have a very negligible impact on performance. I don't see any obvious way to improve performance. JwksVerificationKeyResolver does iterate over all the keys so if you have a very large number of keys that could be an area of improvement.
-
reporter You are saying most of the time is consumed by signature validation. But there was a significant difference when I am profiling verifySignature and processToClaims. Time consumed by JsonWebSignature's verfiySignature method was somewhere between 3000-4000 ms while JwtConsumer processToClaims took 12000 ms - 20000 ms.
-
repo owner That's different than what I would have expected and I'm afraid I don't have any suggestions.
-
repo owner - changed status to closed
- Log in to comment