2D canvas API in open() window is excruciatingly slow (1fps vs 60fps normally)

NEW
Unassigned

Status

()

3 years ago
3 years ago

People

(Reporter: evanw, Unassigned)

Tracking

42 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: gfx-noted)

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
Created attachment 8687662 [details]
wtf.html

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.35 Safari/537.36

Steps to reproduce:

Open attached file in Firefox 42.0 on OS X 10.10.5. Move mouse around, observe nice 60fps framerate. Click the "Open in a new window button" to open the same code in a popup window. Move mouse around, observe excruciating 1fps framerate.

I discovered this when trying to make a playground for a programming language I've been developing: http://skew-lang.org/. This scenario works fine in Chrome but terribly in Firefox.
Wow.

Seth, are we erroneously throttling the refresh driver in the popup window?
Flags: needinfo?(seth)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Debugged this. This actually has the same cause as bug 1190093. The document appears to still be loading, we just can't see this in the ui because it is in a new window with no tabs and there is no ui to show loading then (seems like we should fix that). If you press escape when the new window document is focused you will stop the loading and the page will update at a reasonable fps.

But I observed a weird effect when doing this: the fps will be capped at 30 in the new window. If I go back to the original window it can do 60 fps. The new window still does 30 when I switch back to it again though.

Evan, I think you should be able to work around this issue temporarily by surrounding your document.write with document.open and document.close.
Flags: needinfo?(seth)
(Reporter)

Comment 3

3 years ago
Yay, thanks for the workaround! Never would have figured that out myself. 1000x better.

Updated

3 years ago
Component: Untriaged → Canvas: 2D
Product: Firefox → Core
Depends on: 1190093
Whiteboard: gfx-noted

Comment 4

3 years ago
(In reply to Timothy Nikkel (:tn) from comment #2)
> Debugged this. This actually has the same cause as bug 1190093. The document
> appears to still be loading, we just can't see this in the ui because it is
> in a new window with no tabs and there is no ui to show loading then (seems
> like we should fix that). If you press escape when the new window document
> is focused you will stop the loading and the page will update at a
> reasonable fps.
> 
> But I observed a weird effect when doing this: the fps will be capped at 30
> in the new window. If I go back to the original window it can do 60 fps. The
> new window still does 30 when I switch back to it again though.
> 
> Evan, I think you should be able to work around this issue temporarily by
> surrounding your document.write with document.open and document.close.

JFYI, I don't have that 30fps problem after pressed "Esc".
You need to log in before you can comment on or make changes to this bug.