Skip to content

Improve playlist import performance - #8062

Merged
FreeTubeBot merged 1 commit into
FreeTubeApp:developmentfrom
absidue:playlist-import-performance
Sep 22, 2025
Merged

FreeTubeBot merged 1 commit into
FreeTubeApp:developmentfrom
absidue:playlist-import-performance

Conversation

@absidue

@absidue absidue commented Sep 21, 2025 •

Copy link
Copy Markdown
Member

Pull Request Type

  • Performance improvement

Related issue

FreeTubeAndroid#505

Description

This pull request improves the performance of playlist imports by reducing the number of store and database updates, along with a few other minor performance improvements. Previously we would add each new playlist to the store and database individually, now they are added in one go. If a playlist already exists we used to add each new video to the playlist individually and then an extra update at the end to update the playlist metadata, now we do one single store and database update for the entire playlist.
That means if the import contains more than one new playlist or one of the existing playlists receives at least one new video, there will be less store and database updates, which should be the case for most imports (I suspect that importing a completely identical playlist database is a very rare occurence).

Testing

Test that importing playlist databases still works correctly. If you want to verify that it does less updates to the database you can add some logging to the Playlists class in src/datastores/handlers/base.js.

Desktop

  • OS: Windows
  • OS Version: 11

@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Sep 21, 2025
@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) September 21, 2025 11:01
@FreeTubeBot
FreeTubeBot merged commit 07e44fe into FreeTubeApp:development Sep 22, 2025
@github-actions github-actions Bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Sep 22, 2025
@absidue
absidue deleted the playlist-import-performance branch September 22, 2025 05:45
PikachuEXE added a commit to NishPatel101/FreeTube that referenced this pull request Sep 23, 2025
* development: (43 commits)
  Bump the eslint group across 1 directory with 4 updates (FreeTubeApp#8073)
  Bump electron from 38.1.0 to 38.1.2 (FreeTubeApp#8071)
  Bump sass from 1.92.1 to 1.93.0 (FreeTubeApp#8067)
  Bump lefthook from 1.13.0 to 1.13.1 (FreeTubeApp#8072)
  Bump swiper from 12.0.1 to 12.0.2 (FreeTubeApp#8070)
  Translated using Weblate (Italian)
  Translated using Weblate (Czech)
  Translated using Weblate (Hungarian)
  Translated using Weblate (German)
  Translated using Weblate (Estonian)
  Translated using Weblate (Breton)
  Translated using Weblate (German)
  Translated using Weblate (Chinese (Traditional Han script))
  Improve playlist import performance (FreeTubeApp#8062)
  Translated using Weblate (Norwegian Bokmål)
  Translated using Weblate (Portuguese (Brazil))
  Translated using Weblate (Chinese (Simplified Han script))
  Translated using Weblate (Japanese)
  Handle lockup view videos without a view count (FreeTubeApp#8066)
  Add proxy login support (FreeTubeApp#7996)
  ...
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Sep 23, 2025
* development:
  Bump the eslint group across 1 directory with 4 updates (FreeTubeApp#8073)
  Bump electron from 38.1.0 to 38.1.2 (FreeTubeApp#8071)
  Bump sass from 1.92.1 to 1.93.0 (FreeTubeApp#8067)
  Bump lefthook from 1.13.0 to 1.13.1 (FreeTubeApp#8072)
  Bump swiper from 12.0.1 to 12.0.2 (FreeTubeApp#8070)
  Translated using Weblate (Italian)
  Translated using Weblate (Czech)
  Translated using Weblate (Hungarian)
  Translated using Weblate (German)
  Translated using Weblate (Estonian)
  Translated using Weblate (Breton)
  Translated using Weblate (German)
  Translated using Weblate (Chinese (Traditional Han script))
  Improve playlist import performance (FreeTubeApp#8062)
  Translated using Weblate (Norwegian Bokmål)
  Translated using Weblate (Portuguese (Brazil))
  Translated using Weblate (Chinese (Simplified Han script))
  Translated using Weblate (Japanese)
  Handle lockup view videos without a view count (FreeTubeApp#8066)
@PikachuEXE PikachuEXE mentioned this pull request Sep 23, 2025
1 of 4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants