Performance regression on crypto `createPublicKey` and `createPrivateKey` APIs after node v17
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, node.js
- Domain
- performance
Research direction
Start with verify.js around lines 122-125 and review the linked Node.js issue about createPublicKey and createPrivateKey performance. Reproduce the profiler-server workload across Node v16 and v18, then determine whether reducing these calls is safe. Done requires evidence that the regression is reduced without changing JWT verification behavior.
Written by the indexing model from the issue text.
Description
Hi, we use this package for our profiler-server repository. After upgrading the node version from v16 to v18, we observed ~30% performance regression. And after some investigation we realized that it's because of the createPublicKey and createPrivateKey calls that happen here:
https://github.com/auth0/node-jsonwebtoken/blob/bc28861f1fa981ed9c009e29c044a19760a0b128/verify.js#L122-L125
I also filed an issue on nodejs for the regression on those APIs. For more context, please see it here: https://github.com/nodejs/node/issues/50386
I was wondering if we can reduce the calls to these APIs in this repository with some caching mechanism maybe? I'm not sure as I'm not familiar with the code here. Wanted to ask to see if you have any ideas, thanks!
Version of this library used: 9.0.2
- Dominant language
- JavaScript
- Stars
- 18.2k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from auth0/node-jsonwebtoken
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
auth0/node-jsonwebtoken#1042 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
auth0/node-jsonwebtoken#1000 · 2 comments · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 65/100
auth0/node-jsonwebtoken#1046 ·
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
auth0/node-jsonwebtoken#1034 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
auth0/node-jsonwebtoken#1032 ·
All issues in auth0/node-jsonwebtoken
Similar issues
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Automattic/safe-publish#594 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
dream-num/dsh-univer-office#104 ·
-
comp/dashboard invalid P3
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
NousResearch/hermes-agent#121143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
avniproject/avni-webapp#1811 ·
-
area/auroraboot area/webui bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100