@:mstange: Thank you for your research! Your findings in bug 1579664 where very interessting and they also lead to an annoying behavior of Firefox (compared to Chrome) when it comes to emscripten-compiled performance-hungry "multimedia" apps such as games based on Unity, DosBox and the likes:
The first time you open them with Firefox on a MacBook Pro, the internal (slow) GPU is used. You can see in the log (shift+apple+j) , that after a second or so, the MacBook switches to the fast GPU, but Firefox still uses the slow GPU context, i.e. the Unity game app, DosBox-emscripten or whatever you are running is slow. Then, if you quickly press page reload (e.g. apple+R), then the fast GPU / discrete GPU is still active, and then also Firefox' GL context is tied to the correct GPU and then everything is fast as expected.
Chrome does this right in the first place.
I think this is a "dangerous" bug for Firefox' reputation, because people would tend to assume, that Firefox is just slow, because they would not expect that a simple page reload will triple or quadruple the frame rate.
(Also as described in at another bug, i.e. bug 1615061)