-
Notifications
You must be signed in to change notification settings - Fork 36
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
Use built-in PBKDF2 implementation #295
Conversation
packages/status-js/vite.config.ts
Outdated
@@ -4,12 +4,28 @@ import { defineConfig } from 'vite' | |||
|
|||
import { dependencies } from './package.json' | |||
|
|||
import type { Alias } from 'vite' | |||
|
|||
const isTest = process.env.NODE_ENV === 'test' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would do it the same, but I remember reading this from their docs:
Use process.env.VITEST or mode property on defineConfig (will be set to test if not overridden) to conditionally apply different configuration in vite.config.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx 👍, done.
@prichodko I don't have the video recording, but at the beginning I took the following perf recording: Before using
After:
Let me know if you'd like the exports of those perf recording too. |
* add pbkdf2 browser implementation * use webcrypto in pbkdf2 * rename pbkdf2 file * use pbkdf2 * add changeset * revert rename * remove browser field from package.json * use `resolve.alias` for pbkdf2 if test * use `mode` in vite.config.ts Co-authored-by: Felicio Mununga <felicio@users.noreply.github.com>
PBKDF2 is used for generating symmetric keys for the community and every chat for the community.
In a community with ~25 chats, the generation of keys using the PBKDF2 vanilla implementation from ethereum-cryptography took ~10-50 seconds. After migrating for built-in browser implementation it now only takes ~1 second and utilizes multiple threads.
See @felicio's comment for detailed comparison.