Thanks for all the info! I played around with the various tools you suggested, unfortunately it didn't get me very far. The looking glass view is especially neat, I'm just not sure what we can learn from it yet. Maybe profiling + screen casting with the looking glass view would help correlate high cpu/gpu usage with certain patterns of overlays. I think there's definitely uses for those tools.
I did have some sucess with
intel_gpu_top. It can output to JSON (thanks man page), and I was able to (somewhat manually) benchmark forty.gnome.org. It seemed like a decent (animation heavy) site to start off. An extension scrolled all the way down the page, then up the page, and then down again automatically (800px/s).
There are several issues I want to sort out before I'm more confident in my results:
- A more reliable way to get Firefox to autoscroll down and up automatically. I used the Foxscroller FF extension which I found to not work very consistently.
- A better way to graph and analyze the JSON than the website I found. I'd like averages, perhaps the total sum of energy used over time as well. I see a lot of spikes, which makes it hard to say what's going on.
- A script should start both Firefox and the logger at the same time, I tried doing this but I couldn't get it to work, it's surely doable though.
- It would be nice to automatically flip the preference as well (maybe 2 Firefox profiles?)
- More websites to test on is definitely needed.
- Test different window sizes, i.e. maximized, half sized, quarter, etc.
Nevertheless here is the graph of time versus total package power (cpu+gpu), with
gfx.webrender.compositor.force-enabled enabled, and disabled.
Data (should) be taken every 10 ms. Command used was
sudo intel_gpu_top -s 10 -J -o testfile and
MOZ_ENABLE_WAYLAND=1 ./firefox https://forty.gnome.org. Note the first section of the first picture is very low due to me running the commands seperately (Firefox hadn't opened yet). Also enclose the entire JSON with  otherwise it will be invalid. Tested on Nightly Tarball 91.0a1 (2021-06-23) (64-bit). Other apps were open, but nothing major graphically was happening (Probably worth closing them though once I've got the procedure figured out). about:support: WebRender and Wayland enabled.
Again I'm not very confident that these results are meaningful, more automatation and other fixes are needed before then. Still I hope this is helpful :)