You are not logged in.

#1 2016-02-20 14:52:02

FlowIt
Member
Registered: 2014-10-25
Posts: 239

[Solved] Firefox Youtube high CPU load

Watching videos on Youtube (html 5) brings my firefox instance to 80 or more percent CPU load, depending on the quality. With 360p I get around 30%, 1080p is 90% and spikes to 100%. I disabled webm completely. Hardware acceleration is enabled, I have an Intel HD 3000. The intersting thing is that this high CPU load only occures on Youtube, every other platform I tried (html 5 only) cannot bring my CPU to more than 25% load. So I assume Youtube uses a codec which I cannot do in hardware. Any hints what I can tweak to test out some more cases?

Last edited by FlowIt (2016-02-21 20:37:07)

Offline

#2 2016-02-20 15:25:50

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,806
Website

Re: [Solved] Firefox Youtube high CPU load

Try disabling media.mediasource.enabled.


https://ugjka.net
paru > yay | webcord > discord
pacman -S spotify-launcher
mount /dev/disk/by-...

Offline

#3 2016-02-20 15:32:56

FlowIt
Member
Registered: 2014-10-25
Posts: 239

Re: [Solved] Firefox Youtube high CPU load

Disabling leads to missing options for the video quality (missing in the sense of no longer supported) without getting better resource usage, the best quality is 720p which still needs between 50 and 60% of the CPU, more than other streaming services with the same quality.

Offline

#4 2016-02-20 17:33:26

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: [Solved] Firefox Youtube high CPU load

Are you using html5 or flash? I it's flash is it adobe flash or chromium pepper flash? I think pepper flash takes the most resources, then html5 then adobe flash.

Offline

#5 2016-02-20 21:20:30

FlowIt
Member
Registered: 2014-10-25
Posts: 239

Re: [Solved] Firefox Youtube high CPU load

Html5 only, everywhere.

Offline

#6 2016-02-20 21:38:22

loqs
Member
Registered: 2014-03-06
Posts: 17,321

Re: [Solved] Firefox Youtube high CPU load

Right click the youtube video -> Stats for nerds -> Mime Types
That should contain the codec being used.

Offline

#7 2016-02-21 19:42:40

FlowIt
Member
Registered: 2014-10-25
Posts: 239

Re: [Solved] Firefox Youtube high CPU load

It's mp4,avc/h264 as expected. So this should not be the problem. I ran intel_gpu_top to get some actual numbers (although I really don't know how to interpret them). First one is non-Yt on 720p, second one is Yt on 1080p. Clearly GPU usage on Yt is less than on non-Yt.

# time	render%	ops
61.01	 33	55
62.01	 16	21
63.01	  2	1	
64.01	  3 	2	
65.01	 11	12
66.01	 10	11
67.01	  9	10
68.01	  9 	10
69.01	  9 	9
70.01	  9	11
71.01	 11	13
72.01	 12	11
73.01	 33	48
74.01	 41	64
75.01	 43	59
76.01	 43	81
77.01	 42	65
78.01	 41	75
79.01	 42 	71
80.01	 41	61	
81.01	 41 	57
82.01	 43	69
83.01	 43	52
84.01	 42 	60
85.01	 42	53
86.01	 42	60
87.01	 42	55
88.01	 43	69
89.01	 43	61
90.01	 41	57
91.01	 42	65
92.01	 42	55
93.01	 43	67
94.01	 42	58
95.01	 42	63
96.01	 43 	66
97.01	 43	74
98.01	 42	65
99.01	 41	54
100.01	 42 	63
101.01	 44	66
102.01	 42	65
103.01	 30	51
104.01	 12	14
105.01	 24	36	
106.01	 30	44
107.01	  2	4
# time	render%	ops
52.01	  2	2
53.01	 15	18
54.01	 13	15
55.01	  9	9
56.01	 12	11
57.01	 20	26
58.01	 26	33
59.01	 25	30
60.01	 22	25
61.01	 21	23
62.02	 24	27
63.02	 26	30
64.02	 31	40
65.02	 37	43
66.02	 32	38
67.02	 35	41
68.03	 31	39
69.03	 36	47
70.03	 35	40
71.03	 35	43
72.03	 37	47
73.03	 29	35
74.03	 37	49
75.03	 36	40
76.03	 32	39
77.03	 28	33
78.03	 31	36
79.03	 34	41
80.03	 35	42
81.03	 38	43
82.03	 30	34
83.03	 34	38
84.03	 35	41
85.03	 36	40
86.03	 33	41
87.04	 40	43
88.04	 29	34
89.04	 35	43
90.05	 33	42
91.05	 35	45
92.05	 39	46
93.05	 36	44
94.06	 42	54
95.06	 33	39
96.06	 29	31
97.07	 30	32
98.07	 32	42
99.07	 29	39
100.08	 27	30
101.08	 30	37
102.08	 30	38
103.08	 34	38
104.08	 35	42
105.08	 35	38
106.08	 29	34
107.08	 31	39
108.08	 32	38
109.08	 23	28
110.08	 32	37
111.08	 19	21
112.08	  4	4

Offline

#8 2016-02-21 20:07:17

loqs
Member
Registered: 2014-03-06
Posts: 17,321

Re: [Solved] Firefox Youtube high CPU load

FlowIt wrote:

It's mp4,avc/h264 as expected. So this should not be the problem.

http://mxr.mozilla.org/mozilla-central/ … der.cpp#35

Offline

#9 2016-02-21 20:36:50

FlowIt
Member
Registered: 2014-10-25
Posts: 239

Re: [Solved] Firefox Youtube high CPU load

Looks like I was wrong. Great find, but still - how come the difference? The comment clearly says that videos are in general not hw-accelerated. Probably Yt uses a not-so-common pixel format which needs more time to decode?
Nevertheless I mark this as solved, this issue is clearly missing hw-acceleration in Firefox, nothing I can do from my side, and the high CPU usage is most likely related to some Yt specifics.

Offline

Board footer

Powered by FluxBB