Closed Bug 1313675 Opened 8 years ago Closed 2 years ago

Poor performance of rendering danmaku on HTML5 player on Bilibili

Categories

(Core :: Graphics: Text, defect, P3)

defect

Tracking

()

RESOLVED INACTIVE
Tracking Status
firefox52 --- wontfix
firefox55 --- affected

People

(Reporter: xidorn, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: perf, Whiteboard: [country-cn])

Attachments

(1 file)

Steps to reproduce:
1. visit http://www.bilibili.com/video/av105005/
2. if you see a white dialog titled "HTML5播放器公测公告" (HTML5 Player Beta Announcement), check the checkbox before "默认使用HTML5播放器" (Use HTML5 player by default), and click the blue button "朕知道了" (I know).
3. you can see three buttons on the right side of the page aligned to the video area vertically, the first starts with "HTML5", and the second starts with "Flash". click the "HTML5" one.
4. when the video area shows any picture, click the progress bar to jump to 04:20, and wait for 5s.

Expected result:
The text over the video should move smoothly.

Actual result:
The whole page is frozen for several seconds, including the time on the progress bar.


As a background, Bilibili is a famous Chinese video sharing website featuring anime-related videos. Danmaku means piece of text floating with the video playing.
Attached file about:support
This is the info from about:support. It is on a MacBook Pro (Retina, 15-inch, Late 2013) with Mac OS X 10.10.5 installed.
Chrome doesn't have the same performance issue, so I suppose there is something we can improve.
Whiteboard: [country-cn]
Looking at the profiling report... We spend the majority of time blocking on mach_msg_trap?! Why's that...
Flags: needinfo?(aschen)
Ethan, per talk, pls help on further investigation and see how we can improve the experience on canvas stroking.
Assignee: nobody → ethlin
Status: NEW → ASSIGNED
Flags: needinfo?(aschen)
OS: Unspecified → All
Hardware: Unspecified → All
Keywords: perf
After some study, gecko seems to spend a lot of time on creating AdjustedTarget. I'll keep investigating.
Priority: -- → P3
Depends on: 1319362
Shadow effect takes lots of time. Sometimes Gecko doesn't use SkiaGL due to the limitation [1] of the size. I open bug 1319362 for changing the limitation. 

[1] https://hg.mozilla.org/mozilla-central/annotate/0534254e9a40b4bade2577c631fe4cfa0b5db41d/dom/canvas/CanvasRenderingContext2D.cpp#l1445
(In reply to Ethan Lin[:ethlin] from comment #7)
> Shadow effect takes lots of time. Sometimes Gecko doesn't use SkiaGL due to
> the limitation [1] of the size. I open bug 1319362 for changing the
> limitation. 
> 
> [1]
> https://hg.mozilla.org/mozilla-central/annotate/
> 0534254e9a40b4bade2577c631fe4cfa0b5db41d/dom/canvas/CanvasRenderingContext2D.
> cpp#l1445

The patch in bug 1319362 improves about 30% performance of shadow effect rendering on this page. But the playback is still laggy comparing to chrome and the shadow effect still takes too much time.
Thanks, Ethan. So how is the fps after applying the patch in bug 1319362 ?
(In reply to Astley Chen [:astley] (UTC+8) from comment #9)
> Thanks, Ethan. So how is the fps after applying the patch in bug 1319362 ?

The fps various depending on the content. Normally the fps is 60 but sometimes it downgrades to 0 on my mbp. After the patch, it only downgrades to about 10fps for the same part of the video.
I also added some code to measure the time spending on shadow effect. For the clip 4:20~4:30, originally we spend about 0.45 sec for shadow effects. After bug 1319362, shadow effects only cost about 0.02sec.
Mass wontfix for bugs affecting firefox 52.
Blocks: 1633864
No longer blocks: 1633864
Depends on: 1633864
See Also: → 1656959

Does this still reproduce? Could you get a new profile?

Flags: needinfo?(xidorn+moz)

There doesn't seem to be any problem now.

But I'm using a different machine, and I have enabled WebRender, just FYI.

Flags: needinfo?(xidorn+moz)

The bug assignee didn't login in Bugzilla in the last 7 months.
:lsalzman, could you have a look please?
For more information, please visit auto_nag documentation.

Assignee: demo99 → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(lsalzman)
Flags: needinfo?(lsalzman)
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: