-
-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: improve indexing speed by 250%
- Loading branch information
Showing
9 changed files
with
547 additions
and
262 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
Oops, something went wrong.
5ae0247
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain how the performance gain works ?
5ae0247
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, it simply takes advantage of concurrent processess and isolates
a chunk size list (which size is calculated depending on free ram) so lets say 64 tracks
namida/lib/controller/indexer_controller.dart
Line 850 in dbf8256
then in the looper, we loop tracks normally without extraction, but adding them to the chunkList, and when the size of the list matches the chunkSize, we sent these tracks (64) to [extractOneTrack (old name)] method, and clear the chunk list
namida/lib/controller/indexer_controller.dart
Lines 868 to 881 in dbf8256
namida/lib/controller/indexer_controller.dart
Lines 468 to 476 in dbf8256
namida/lib/controller/indexer_controller.dart
Lines 434 to 446 in dbf8256
the result from [extractOneTrackIsolate] is then sent back to [extractOneTrack] to be added to all related lists, while also calling [extractOneArtwork] to save artworks to cache directory (executed in isolate too)
namida/lib/controller/indexer_controller.dart
Lines 547 to 558 in dbf8256
5ae0247
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your clear explanation.
Happy coding