-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Since #6, we noticed a severe performance degradation when performing search. We measured the following: - Flexsearch search: <ms - Query cozy-client store to get file paths: ~120ms for 60 files. - Results normalization: ~3ms We used to make multiple `getById` queries to get file path, each of them taking few ms. So we tried to use a `getByIds` instead, and got ~70ms per query, which is better, but still slow. Then, we tried the following: ``` const allFiles = client.getCollectionFromState(FILES_DOCTYPE) as IOCozyFile[] const dirs = allFiles.filter(file => file.type === TYPE_DIRECTORY) return dirs.filter(dir => dirIds.includes(dir._id)) ``` This takes 2ms. We should eventually investigate why the store queries are so slow, but for now let's use this trick.
- Loading branch information
1 parent
05534bd
commit 5d619aa
Showing
7 changed files
with
57 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters