Draft: analyzing slowness (not to be merged)
Context
The app can be very slow sometimes but it is even worse in dist mode. These situations arrive mostly during signing parts on when dealing with crypto.
Here are some narrowing of this behaviour.
in dev mode (execution time in ms)
in dist mode (execution time in ms)
The culprit
In taquito's InMemorySigner
constructor(key: string, passphrase?: string) {
...
const encryptionKey = pbkdf2.pbkdf2Sync(passphrase, salt, 32768, 32, 'sha512');
...
}
and in umami's HD.re
let edesk = (path, seed, ~password) => {
...
let encryptionKey = pbkdf2Sync(password, salt);
...
};
Something that might be related on pbkdf2 :
Conclusion: unrelated
pbkdf2
by crypto
Replace crypto
has the same implementation as pbkdf2
but in node. Replacing this deps both in umami and in a vendored taquito signer produces an extremely fast onboarding.
in dist mode, we have:
Edited by Rémy El Sibaïe