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

Performance downgrade from version 1.1.3 to 2.0.0 #335

Open
murilohns opened this issue Jan 19, 2022 · 0 comments
Open

Performance downgrade from version 1.1.3 to 2.0.0 #335

murilohns opened this issue Jan 19, 2022 · 0 comments

Comments

@murilohns
Copy link

Consider this code:

  const decryptedJWE = await jose.JWE.createDecrypt(keystore)
    .decrypt(encrypted_data)

  const jwtPayload = decryptedJWE.payload.toString()

  const jwsPayload = await jose.JWS.createVerify(keystore)
    .verify(jwtPayload, { allowEmbeddedKey: true })

  const stringifiedWebhook = jwsPayload.payload.toString()

  const webhookResult = JSON.parse(stringifiedWebhook)

I had a lambda function using the libray 2.0.0 version. And when I execute this code, the time to finish it process was 12 seconds.
image

Then, when I downgrade the library version to 1.1.3, the time to process it take 5 seconds or less.
image

Lambda configuration:
Node version: 14
Memory Size: 128 MB

Tip: upgrading the memory to 1024MB decrypt the content 10 times faster.

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

No branches or pull requests

1 participant