plugins-workspace: Stronghold.load() is slow

In my JS code, I run the following code:

appDataDir()
.then(async dir => {
  console.log(dir)
  const vaultPath = `${dir}/vault.hold`;
  const vaultPassword = 'vault_password';
  const stronghold = await Stronghold.load(vaultPath, vaultPassword);
  console.log("TEST");
})

The time between the first and second log is always somewhere between 1 and 2 minutes. Is there a reason why Stronghold.load() is so slow for me?

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 7
  • Comments: 19 (2 by maintainers)

Commits related to this issue

Most upvoted comments

Running in release mode does make things a bit more inconvenient.

Just as a workaround, I created a simple class with getKey, setKey and removeKey methods. Using env variables to check if I’m in DEV or PROD if in DEV I use localStorage just to quickly test without having to wait, and only in PROD will be using stronghold.

Issue seems to be with the scrypt crate, which is a dependency of iota-crypto. Try adding this to Cargo.toml

[profile.dev.package.scrypt]
opt-level = 3

@gabriel-le Yes, it’s the same here.