browsertime icon indicating copy to clipboard operation
browsertime copied to clipboard

Firefox PerfStats feature mask needs to be updated to support 64bit mask

Open acreskeyMoz opened this issue 6 months ago • 9 comments

Have you read the documentation?

URL

https://www.anysite.com

What are you trying to accomplish

We currently initialize the Firefox PerfStats (internal timing metrics) with a 32-bit feature mask, 0xFF_FF_FF_FF meaning collect all metrics.

https://github.com/sitespeedio/browsertime/blob/89c2ec6215d6ab6519a184a91f6b1d38eb2604e7/lib/core/engine/command/perfStats.js#L29

However, Firefox has since upgraded to a 64-bit feature mask, so we want to pass in 0xFFFF_FFFF_FFFF_FFFF to collect all metrics.

What browser did you use?

Firefox

How to reproduce

Collect PerfStats and observe that the last ones are all zero.

Log output


acreskeyMoz avatar Jul 17 '25 17:07 acreskeyMoz

Patch incoming.

acreskeyMoz avatar Jul 17 '25 17:07 acreskeyMoz

JavaScript cannot represent this integer.

> (0xFFFF_FFFF_FFFF_FFFF).toString(16)
"10000000000000000" 

mstange avatar Jul 19 '25 21:07 mstange

JavaScript cannot represent this integer.

> (0xFFFF_FFFF_FFFF_FFFF).toString(16)
"10000000000000000" 

Ah, maybe that's why the linter wasn't happy.

This bigInt is valid though, right? 0xFF_FF_FF_FF_FF_FF_FF_FFn

https://github.com/sitespeedio/browsertime/pull/2314/files

acreskeyMoz avatar Jul 21 '25 18:07 acreskeyMoz

Ah yes, a BigInt would work. But then we also have to fix ChromeUtils.setPerfStatsCollectionMask on the Firefox side to accept BigInts.

mstange avatar Jul 21 '25 18:07 mstange

Hmm, that may be tricky?

https://searchfox.org/mozilla-central/rev/78884344be27b9033bcea5660e0214477567a899/dom/chrome-webidl/ChromeUtils.webidl

It's not clear to me how we would express BigInt in webIdl, but maybe I'm missing something https://firefox-source-docs.mozilla.org/dom/webIdlBindings/index.html

acreskeyMoz avatar Jul 21 '25 21:07 acreskeyMoz

I don't know the answer, this is a question for our DOM team

mstange avatar Jul 21 '25 21:07 mstange

From mgaudet:

https://webidl.spec.whatwg.org/#idl-bigint

acreskeyMoz avatar Aug 28 '25 15:08 acreskeyMoz

I may have spoken too soon: https://bugzilla.mozilla.org/show_bug.cgi?id=1764326

mgaudet avatar Aug 28 '25 16:08 mgaudet

This is fixed now. We are using a string of features now.

dpalmeiro avatar Nov 06 '25 20:11 dpalmeiro