Skip to content
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

Creating or extending search index is slow #6278

Closed
bedhub opened this issue Dec 11, 2023 · 3 comments · Fixed by #6279
Closed

Creating or extending search index is slow #6278

bedhub opened this issue Dec 11, 2023 · 3 comments · Fixed by #6279
Labels
bug broken functionality, usability problems, unexpected errors state:tested We tested it and are about to release it
Milestone

Comments

@bedhub
Copy link
Contributor

bedhub commented Dec 11, 2023

Describe the bug
Search index creation is very slow even if there are just a few hundred emails in the inbox. I noticed that when trying to find an email in my personal mailbox that is from 8 years ago but it is also slow if i just create the initial mail index for the first 30 days.

To Reproduce
Steps to reproduce the behavior:

  1. Login in to desktop or web app.
  2. Ensure that no credentials or search index is stored for the account you want to test with (check using dev tools)
  3. Enable search and observe log
  4. Check search index performance output from IndexerCore.ts

Expected behavior
Search index is created in a few seconds.

Additional context
Here is an example of the initial indexin

30 days, 74 mails, 50670ms

IndexerCore.ts:941 {"indexingTime":57.59999999962747,"storageTime":1480,"preparingTime":49190.19999999739,"mailcount":74,"storedBytes":760928,"encryptionTime":369.199999996461,"writeRequests":5148,"largestColumn":295,"words":5012,"indexedBytes":682158,"downloadingTime":48763.400000001304} total time:  50670.19999999739

Similar results for extending the index for 30 more days.
next 30 days, 61 mails, 58618ms

IndexerCore.ts:941 {"indexingTime":57.599999997764826,"storageTime":1886,"preparingTime":56732.50000000186,"mailcount":61,"storedBytes":649648,"encryptionTime":353.40000000037253,"writeRequests":4285,"largestColumn":413,"words":1989,"indexedBytes":663768,"downloadingTime":56321.500000003725} total time:  58618.50000000186. 
@bedhub bedhub added bug broken functionality, usability problems, unexpected errors desktop Desktop client related issues and removed desktop Desktop client related issues labels Dec 11, 2023
@ganthern
Copy link
Contributor

ganthern commented Dec 12, 2023

"preparingTime":56732.50000000186

that's loading the mail (from cache or server)

"downloadingTime":56321.500000003725

that's downloadingTime: this._stats.preparingTime - this._stats.indexingTime - this._stats.encryptionTime

so it's the server? since this happens on the web app and the desktop app and those use different cache implementations (the web app one is always empty on startup). Definitely worth exploring though, that's ludicrous.

@charlag
Copy link
Contributor

charlag commented Dec 12, 2023

Last time I've checked it was re-downloading the same emails over and over which is not ideal obviously

ganthern added a commit that referenced this issue Dec 12, 2023
@ganthern ganthern added the state:done meets our definition of done label Dec 12, 2023
@ganthern ganthern added this to the 3.119.4 milestone Dec 12, 2023
ganthern added a commit that referenced this issue Dec 12, 2023
ganthern added a commit that referenced this issue Dec 12, 2023
ganthern added a commit that referenced this issue Dec 12, 2023
ganthern added a commit that referenced this issue Dec 12, 2023
ganthern added a commit that referenced this issue Dec 12, 2023
ganthern added a commit that referenced this issue Dec 12, 2023
ganthern added a commit that referenced this issue Dec 12, 2023
ganthern added a commit that referenced this issue Dec 12, 2023
ganthern added a commit that referenced this issue Dec 12, 2023
ganthern added a commit that referenced this issue Dec 12, 2023
ganthern added a commit that referenced this issue Dec 12, 2023
ganthern added a commit that referenced this issue Dec 12, 2023
ganthern added a commit that referenced this issue Dec 12, 2023
ganthern added a commit that referenced this issue Dec 12, 2023
ganthern added a commit that referenced this issue Dec 12, 2023
@murilopereirame
Copy link
Contributor

Seems to be working

First Indexing

{
  "indexingTime": 9,
  "storageTime": 147,
  "preparingTime": 2590,
  "mailcount": 74,
  "storedBytes": 204944,
  "encryptionTime": 80,
  "writeRequests": 640,
  "largestColumn": 231,
  "words": 626,
  "indexedBytes": 46689,
  "downloadingTime": 2501
}

Total Time: 2737

Second Indexing

{
  "indexingTime": 294,
  "storageTime": 446,
  "preparingTime": 12411,
  "mailcount": 308,
  "storedBytes": 2344256,
  "encryptionTime": 366,
  "writeRequests": 1926,
  "largestColumn": 1116,
  "words": 1550,
  "indexedBytes": 4187640,
  "downloadingTime": 11751
}

Total time: 12857

@murilopereirame murilopereirame added state:tested We tested it and are about to release it and removed state:done meets our definition of done labels Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug broken functionality, usability problems, unexpected errors state:tested We tested it and are about to release it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants