Skip to content

Draft: analyzing slowness (not to be merged)

Rémy El Sibaïe requested to merge analyze-slowness into develop

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)

image

in dist mode (execution time in ms)

image

image

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 :

image

Conclusion: unrelated

Replace pbkdf2 by crypto

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:

image

Edited by Rémy El Sibaïe

Merge request reports