Skip to content

Conversation

@auouymous
Copy link
Member

Internal youtube support and the youtube-dl extension both cause the youtube feed URL to be fetched three times per update. Caching the feed data from feedcore allows internal support to only load the feed once. The lru_cache removes one of the youtube-dl fetches, not perfect, but two is better than three. I saw a 40% decrease in update times when using the internal youtube code.

Throwing an exception from get_channel_id_url() prevents get_cover() and get_channel_desc() from attempting to fetch a None URL, and provides more accurate errors.

The lru_cache on get_youtube_id() saves 1ms per youtube channel when updating. Which adds up with a lot of channels, and might be more on slower devices.

get_youtube_id() is also called when displaying each downloaded episode, and increasing the cache size from 1 to 128 or more would slightly improve episode pane redrawing when switching between channels. But it only works if the cache size is larger than the total number of downloaded episodes.

Internal youtube support and the youtube-dl extension both cause the
youtube feed URL to be fetched three times per update. Caching the feed
data from feedcore allows internal support to only load the feed once.
The lru_cache removes one of the youtube-dl fetches, not perfect, but
two is better than three. I saw a 40% decrease in update times when
using the internal youtube code.

Throwing an exception from get_channel_id_url() prevents get_cover() and
get_channel_desc() from attempting to fetch a None URL, and provides
more accurate errors.

The lru_cache on get_youtube_id() saves 1ms per youtube channel when
updating. Which adds up with a lot of channels, and might be more on
slower devices.
Avoids parsing the 404 error page as XML and then throwing malformed XML
errors.
@auouymous auouymous merged commit 0bf859b into gpodder:master Mar 7, 2022
@auouymous auouymous deleted the memoize-youtube-channel-id branch March 7, 2022 22:22
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.

1 participant