FreeTube icon indicating copy to clipboard operation
FreeTube copied to clipboard

[Bug]: Abnormally long load times when initially opening Freetube, behaviour not present when "Open New Window" is pressed

Open hjc25 opened this issue 1 year ago • 14 comments

Guidelines

  • [X] I have encountered this bug in the latest release of FreeTube.
  • [X] I have encountered this bug in the official downloads of FreeTube.
  • [X] I have searched the issue tracker for open and closed issues that are similar to the bug report I want to file, without success.
  • [X] I have searched the documentation for information that matches the description of the bug I want to file, without success.
  • [X] This issue contains only one bug.

Describe the bug

  1. Open the application on my desktop
  2. Abnormally longer load time
  3. Open the application on my work machine (running OS build 19045.3930)
  4. Near instant load time

Expected Behavior

The same loading speed as my work machine, which would be the expected behaviour

Issue Labels

inconsistent behavior

FreeTube Version

v0.19.2 Beta

Operating System Version

Windows 10 Pro 22H2 OS Build 19045.4046 Windows Feature Experience Pack 1000.19053.1000.0

Installation Method

.exe

Primary API used

Local API

Last Known Working FreeTube Version (If Any)

v0.19.1 Beta

Additional Information

The desktop has a Ryzen 7 5700X3D and the work machine an Core i7-10700. Both would be plenty fast enough.

Tried nightly build 4059 and the behaviour was still present.

Clicking "open new window" had a near instant load time on the desktop.

Nightly Build

hjc25 avatar Mar 12 '24 21:03 hjc25

Could you please try uninstalling and installing FreeTube again, maybe your anti-virus is slowing it down.

absidue avatar Mar 13 '24 06:03 absidue

Could you please try uninstalling and installing FreeTube again, maybe your anti-virus is slowing it down.

No difference in initial load time.

Antimalware service executable shows no activity during this time.

hjc25 avatar Mar 13 '24 20:03 hjc25

Can you show me a screenshot and is it similar to this?

https://github.com/FreeTubeApp/FreeTube/issues/4701

eshsdhsd avatar Mar 14 '24 07:03 eshsdhsd

Can you show me a screenshot and is it similar to this?

#4701

I'm in the office today so I don't have access to the affected machine at this time, but that extended delay they are experiencing would be the same behaviour. For me, it happens on application launch, not refreshing or opening the new window.

If they can confirm whether or not it also happens at application launch then we have found at what point the abnormal behaviour is occurring.

hjc25 avatar Mar 14 '24 20:03 hjc25

Can you show me a screenshot and is it similar to this?

#4701

At home today, here's the behaviour on my home machine as you requested.

image

hjc25 avatar Mar 16 '24 07:03 hjc25

Can you show me a screenshot and is it similar to this? #4701

At home today, here's the behaviour on my home machine as you requested.

image

Yes this is the same problem as I have, though it happen in new windows for me

eshsdhsd avatar Mar 16 '24 09:03 eshsdhsd

Still not resolved as on 2024-03-24

hjc25 avatar Mar 24 '24 01:03 hjc25

Still not resolved as on 2024-03-24

It's difficult to try to fix something that we can't reproduce, even you said yourself it only happens on one of your computers.

absidue avatar Mar 24 '24 09:03 absidue

Still not resolved as on 2024-03-24

It's difficult to try to fix something that we can't reproduce, even you said yourself it only happens on one of your computers.

Is there some verbose logging I can turn on, spit it out to a log file, and provide in here to see where the deadlock is when I open the app? That could help find the problem.

hjc25 avatar Mar 24 '24 22:03 hjc25

You can try opening the devtools once it has loaded by pressing CTRL+SHIFT+I and looking at the console tab, so see if any errors showed up (red text). Other than that no, we would have to create a custom build for you that litters time measuring code everywhere, which I've been meaning to do but haven't had the time for it, so I didn't mention it here earlier so that I wouldn't get hassled about it.

My only suspicion would have been that your computer is failing to fetch the instances list from api.invidious.io, which times out after 15 seconds (yes I know it's a long timeout but some people have slow connections especially the people that use FreeTube with tor). but that seems rather unlikely because otherwise it would be happening when you open new windows too (currently each window acts like it's own thing).

absidue avatar Mar 24 '24 22:03 absidue

You can try opening the devtools once it has loaded by pressing CTRL+SHIFT+I and looking at the console tab, so see if any errors showed up (red text). Other than that no, we would have to create a custom build for you that litters time measuring code everywhere, which I've been meaning to do but haven't had the time for it, so I didn't mention it here earlier so that I wouldn't get hassled about it.

My only suspicion would have been that your computer is failing to fetch the instances list from api.invidious.io, which times out after 15 seconds (yes I know it's a long timeout but some people have slow connections especially the people that use FreeTube with tor). but that seems rather unlikely because otherwise it would be happening when you open new windows too (currently each window acts like it's own thing).

Scratch the last message, I've got it up now. F12 instead of the CTRL+SHIFT+I

In regards to your comment about failing to fetch invidious instances, looks like it too. Quickly opening F12 and hitting reload after opening FreeTube shows a 25.26s load time for instances.json.

image

However I am using Local API with Fallback to Non-Preferred Backend on Failure Disabled, so Invidious shouldn't be getting touched in this case.

image

And yes, this abnormal load time also doesn't happen when I push that "Open New Window" button. Loads almost instantly.

image

In regards to console logging, all I see after it opens is some feed.xml files returning a 404. Although presumably that the large quantity of subscriptions and YouTube falls back to an RSS feed.

image

When searching a channel, there are some errors on various views, as shown below.

image

There are many when viewing a channel page, so I'll put it in a code snippet instead.

image

(code tags aren't playing ball, so I've moved it to a pastebin instead) https://pastebin.com/KE6JVPP7

On the video player, just the one regarding Merchandise.

image

hjc25 avatar Mar 25 '24 22:03 hjc25

You can try opening the devtools once it has loaded by pressing CTRL+SHIFT+I and looking at the console tab, so see if any errors showed up (red text). Other than that no, we would have to create a custom build for you that litters time measuring code everywhere, which I've been meaning to do but haven't had the time for it, so I didn't mention it here earlier so that I wouldn't get hassled about it.

My only suspicion would have been that your computer is failing to fetch the instances list from api.invidious.io, which times out after 15 seconds (yes I know it's a long timeout but some people have slow connections especially the people that use FreeTube with tor). but that seems rather unlikely because otherwise it would be happening when you open new windows too (currently each window acts like it's own thing).

It happens to me when opening a new window, stays blank for 5-9 seconds then displays

eshsdhsd avatar Mar 30 '24 15:03 eshsdhsd

Still not resolved as on 2024-03-24

It's difficult to try to fix something that we can't reproduce, even you said yourself it only happens on one of your computers.

Throttle your disk mabye when opening a new window? I don't know what causes it.

eshsdhsd avatar Mar 30 '24 15:03 eshsdhsd

Still not resolved as on 2024-03-24

It's difficult to try to fix something that we can't reproduce, even you said yourself it only happens on one of your computers.

Throttle your disk mabye when opening a new window? I don't know what causes it.

Throttle what disk? It's installed to the main boot drive, an NVME SSD. The slowness occurs at any time when opening Freetube.

hjc25 avatar Mar 31 '24 01:03 hjc25

I am having the same issue, but only with v0.20.0. Opening the app shows a blank window for 10 seconds then everything loads. Using v0.19.2 everything loads quickly as expected (2-3 seconds).

I am using Linux Mint 21.3 with the FreeTube AppImage option.

EDIT: Additionally, the blank window is unresponsive to pressing F12 or CTRL+SHIFT+I for the dev console. Only once the 10 second delay has passed the console is shown and the videos load. No errors.

I am not using invidious at all:

image

My-Random-Thoughts avatar Apr 14 '24 12:04 My-Random-Thoughts

When the it will load the content online before displaying the UI. The UI should Display first no matter what instantly regardless if connected to the internet or not, then load the content later.

Slow your internet and you will see the blank screen longer. It's disappointing :disappointed:

EDIT but I found a potential fix of the problem

(Ui display immediate first and everything loads later)

eshsdhsd avatar Apr 18 '24 17:04 eshsdhsd

@eshsdhsd It would have to display a completely empty UI and block you from doing anything with the app, if it fetched the content afterwards.

Also you are using Windows 7, which we don't officially support anymore, so things are going to be dreadfully slow for you regardless of the speed of your internet connection.

absidue avatar Apr 18 '24 17:04 absidue

Slow your internet and you will see the blank screen longer. It's disappointing 😞

My home internet is 900/550 (Mbps) and it'll still be a delay upwards of 15 seconds before the UI loads, content near instant afterwards.

It's not internet related when other non-YouTube clients I use (Revanced, Tubular) are as responsive as FreeTube with fetching the content (after the initial slowdown FreeTube does have) I'm reporting.

hjc25 avatar Apr 18 '24 20:04 hjc25

It's really weird that only 3 FreeTube users have absolutely dreadful connections to api.invidious.io. If you find a way to trigger the problem on a device that it isn't currently happening on, please let me know, because currently there is nothing we can do without any way to reproduce the issue.

absidue avatar Apr 18 '24 20:04 absidue

It's really weird that only 3 FreeTube users have absolutely dreadful connections to api.invidious.io. If you find a way to trigger the problem on a device that it isn't currently happening on, please let me know, because currently there is nothing we can do without any way to reproduce the issue.

You mean that for UI content being loaded from app launch right? The original ticket stated I was using the Local API, correct?

hjc25 avatar Apr 18 '24 20:04 hjc25

It doesn't matter what your preferred backend setting is, FreeTube will always fetch the list of Invidious instances from https://api.invidious.io/instances.json when a window is opened.

absidue avatar Apr 18 '24 21:04 absidue

My issue seems to have fixed itself. It's now loading as quick as it should be. No idea why?!

My-Random-Thoughts avatar Apr 20 '24 11:04 My-Random-Thoughts

My issue seems to have fixed itself. It's now loading as quick as it should be. No idea why?!

Still a slow first load for me here

hjc25 avatar Apr 21 '24 01:04 hjc25

@hjc25 please test this nightly build and report back if that build solved your issue

Tested the APPIMAGE version, and it's slightly quicker, but in a different way. The delay is now before the app starts up

  • Double-click icon
  • Wait...
  • Wait...
  • App window opens
  • Subscription video list appears.

Where-as before the wait was after the app window.

My-Random-Thoughts avatar May 02 '24 14:05 My-Random-Thoughts

@hjc25 please test this nightly build and report back if that build solved your issue

I'm only at my work machine right now, but I've tried with my current subscription list using Newpipe. On launch it had the subscription page loaded within only a few seconds. Promising. I will still need to try on my home machine to be sure this is the fix. This will be later on tonight.

image

hjc25 avatar May 03 '24 01:05 hjc25

Good to hear the initial result is promising. Looking forward to hear about the test results on your home machine.

Good to hear the initial result is promising. Looking forward to hear about the test results on your home machine.

On the home machine now, first launch loaded the UI quickly, but didn't seem to do anything. image

It still took about 30 seconds for the content to load after opening without intervention. image

Subsequent refreshes take only a second or two however. image

hjc25 avatar May 03 '24 11:05 hjc25

It seems to stall for about 20-30 seconds before progressing. I tried opening Freetube then immediately hitting F12 and F5 so I could see active connections.

The URLs I see that are stalling are these:

The first looks like the Github release page, presumably to tell me when there are new updates? https://api.github.com/repos/freetubeapp/freetube/releases?per_page=1 image

The second one look like the website's blog? https://write.as/freetube/feed/ image

Next time you might ask is, what about proxy negotiation? But that has never been turned on because I'm not sitting behind a firewall of content blocking. image

hjc25 avatar May 03 '24 11:05 hjc25

Some errors in the console too

image

hjc25 avatar May 03 '24 12:05 hjc25