# \[Archive\] Performance issues generating new share

**URL:** <https://builder.metamask.io/t/archive-performance-issues-generating-new-share/1397>\
**Category:** Embedded Wallets (Web3Auth)\
**Created:** [January 16, 2024, 2:27am UTC](https://builder.metamask.io/t/archive-performance-issues-generating-new-share/1397 "2024-01-16T02:27:35Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![s11](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@s11](https://builder.metamask.io/u/s11)\
**Post date:** [January 16, 2024, 2:27am UTC](https://builder.metamask.io/t/archive-performance-issues-generating-new-share/1397/1 "2024-01-16T02:27:35Z")

</div>

> **🏛 Archived Content from Web3Auth Community**
> 
> This topic was originally posted by **s11** on 1/16/2024.  
> This content has been migrated from our previous community forum to preserve valuable discussions.

* * *

I am seeing pretty big performance issues when generating new shares. I am generating from a back up share. I have deleted previous web module shares although I haven’t generated a fair amount for a given account. I am wondering why I would be seeing performance issues? Seems like there’s A LOT of network requests going to torus network.

---

<div class="post-metadata">

**Author:** ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.io/u/vjgee)\
**Post date:** [January 16, 2024, 2:44am UTC](https://builder.metamask.io/t/archive-performance-issues-generating-new-share/1397/2 "2024-01-16T02:44:15Z")

</div>

@s11 We recommend you create no more than a total of 6 shares, including your device shares and recovery shares. This is because the more shares you create, it increases the size of the tKey state, which can cause performance issues in the frontend and can slow down the login process. Ideally, you should create 2 recovery shares and ask the user for their trusted devices and only store the device share on them.

Please let us know how many shares do you have.

---

<div class="post-metadata">

**Author:** ![s11](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@s11](https://builder.metamask.io/u/s11)\
**Post date:** [January 16, 2024, 3:28am UTC](https://builder.metamask.io/t/archive-performance-issues-generating-new-share/1397/3 "2024-01-16T03:28:27Z")

</div>

For the particular account I had 4 shares. It seems the issue is when I am generating a new share from the backup share. For other accounts this process is quick. But for a particular account for which I have generated many local shares and have since deleted them it takes quite awhile to generate a new share from the back up share. Why is this?

---

<div class="post-metadata">

**Author:** ![cherngwoei](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@cherngwoei](https://builder.metamask.io/u/cherngwoei)\
**Post date:** [January 18, 2024, 2:31am UTC](https://builder.metamask.io/t/archive-performance-issues-generating-new-share/1397/4 "2024-01-18T02:31:50Z")

</div>

Could you share the network log in the chrome devtool and your code on the login and generate new share for futher debugging?

---

<div class="post-metadata">

**Author:** ![s11](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@s11](https://builder.metamask.io/u/s11)\
**Post date:** [January 18, 2024, 4:46am UTC](https://builder.metamask.io/t/archive-performance-issues-generating-new-share/1397/5 "2024-01-18T04:46:23Z")

</div>

Yes as you can see there are many many calls the the /get endpoint of [metadata.tor.us](http://metadata.tor.us) - this takes up the bulk of the time. Here is the code

```auto

    await tKey.inputShare(mnemonic, "mnemonic");
    const { requiredShares } = tKey.getKeyDetails();
    if (requiredShares <= 0) {
      const reconstructedKey = await tKey.reconstructKey();
      // Do something
    }
    // Generate new share for device storage
    const newShare = await tKey.generateNewShare();
    const shareStore = await tKey.outputShareStore(newShare.newShareIndex);
    await (tKey.modules.webStorage as any).storeDeviceShare(shareStore);

```

[![image](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/d0ad6740fcc071f06905a8cf5a4a1d59a47271fd.png)
image1716×1125 142 KB
](https://web3auth.io/community/uploads/default/original/2X/4/49303d2b221f07fcf8518090bd9cdce36da0305d.png "image")

---

<div class="post-metadata">

**Author:** ![cherngwoei](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@cherngwoei](https://builder.metamask.io/u/cherngwoei)\
**Post date:** [January 18, 2024, 8:10am UTC](https://builder.metamask.io/t/archive-performance-issues-generating-new-share/1397/6 "2024-01-18T08:10:08Z")

</div>

Hi, it is possible that the share that you used to login (`inputShare`) is an old share hence a lot of api calling.

Could you try `inputShare` with a more recent backup share created ?

---

<div class="post-metadata">

**Author:** ![s11](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@s11](https://builder.metamask.io/u/s11)\
**Post date:** [January 18, 2024, 5:44pm UTC](https://builder.metamask.io/t/archive-performance-issues-generating-new-share/1397/7 "2024-01-18T17:44:01Z")

</div>

Yes it is an old share. The backup share was one of the first shares created for this account. It would be unfortunate to have to generate a new backup share just to solve this issue, but you are saying that is the only solution?

Can you tell me why using an old backup share would cause this issue?

And if I generate a new backup share how can I delete the old backup share? How can I get the share index for this backup share?

---

<div class="post-metadata">

**Author:** ![s11](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@s11](https://builder.metamask.io/u/s11)\
**Post date:** [January 20, 2024, 8:44pm UTC](https://builder.metamask.io/t/archive-performance-issues-generating-new-share/1397/8 "2024-01-20T20:44:13Z")

</div>

Any update here? Seems like an inconvenience to have to generate new backup shares just to solve this performance issue. I would think a backup share is something you generate and store as a backup, not having to think much more about it. Any work around?

---

<div class="post-metadata">

**Author:** ![s11](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@s11](https://builder.metamask.io/u/s11)\
**Post date:** [January 20, 2024, 10:41pm UTC](https://builder.metamask.io/t/archive-performance-issues-generating-new-share/1397/9 "2024-01-20T22:41:48Z")

</div>

Another update. I even get rate limited by torus network because its making so many requests. Over 300! What is going on?? I am trying to generate a new backup share but getting blocked.

[![image](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/4ebc9a261dcaea466d2b4cb8797bf952f3c3be50.png)
image739×36 5.79 KB
](https://web3auth.io/community/uploads/default/original/2X/4/4ebc9a261dcaea466d2b4cb8797bf952f3c3be50.png "image")

---

<div class="post-metadata">

**Author:** ![s11](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@s11](https://builder.metamask.io/u/s11)\
**Post date:** [January 20, 2024, 11:01pm UTC](https://builder.metamask.io/t/archive-performance-issues-generating-new-share/1397/10 "2024-01-20T23:01:28Z")

</div>

Now i’ve tried generating a new share, but it failed and now i get `{"name":"CoreError","code":1307,"message":"Share doesn't exist "}'` when using the original back up share …

---

<div class="post-metadata">

**Author:** ![christophe](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@christophe](https://builder.metamask.io/u/christophe)\
**Post date:** [May 14, 2024, 9:30am UTC](https://builder.metamask.io/t/archive-performance-issues-generating-new-share/1397/11 "2024-05-14T09:30:42Z")

</div>

Hello, have you resolved your issue? Because I’m currently facing the same problem. I have several dozen requests to “[https://metadata.tor.us/get](https://metadata.tor.us/get)”.

I had 25 shares and therefore performance issues on react-native. I manually deleted all the shares I no longer use by using the “deleteShare” function of tKey, but this added even more requests to “[https://metadata.tor.us/get](https://metadata.tor.us/get)”.

How can I properly delete shares that are no longer in use?

---

<div class="post-metadata">

**Author:** ![TomTom](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@TomTom](https://builder.metamask.io/u/TomTom)\
**Post date:** [May 14, 2024, 9:32am UTC](https://builder.metamask.io/t/archive-performance-issues-generating-new-share/1397/12 "2024-05-14T09:32:20Z")

</div>

hi @christophe

I hope you are doing great!  
Would you mind creating a new post about this question?

Thanks a lot
