Default to an interval of 2ms on Windows
Because that's the smallest effective resolution we're getting there.
We can probably do something like:
if (navigator.platform === "Win32") {
// change default
}
In the defaults setup: https://github.com/devtools-html/Gecko-Profiler-Addon/blob/002740c4a21ffe48eb7238cd735842ed515512e6/background.js#L110-L122
Yep, like this:
diff --git a/background.js b/background.js
index c22b8d6..f331964 100644
--- a/background.js
+++ b/background.js
@@ -102,6 +102,8 @@ async function restartProfiler() {
await startProfiler();
}
+const isWindows = navigator.platform === "Win32";
+
(async () => {
window.profilerState = (await browser.storage.local.get('profilerState')).profilerState;
@@ -111,7 +113,7 @@ async function restartProfiler() {
isRunning: false,
settingsOpen: false,
buffersize: 1000000,
- interval: 1,
+ interval: (isWindows)? 1 : 2,
features: {
js: true,
stackwalk: true,
@@ -151,4 +153,3 @@ async function restartProfiler() {
}
});
})();
(In reply to @clarkbw from https://github.com/devtools-html/Gecko-Profiler-Addon/issues/42#issuecomment-299948064)
diff --git a/background.js b/background.js index c22b8d6..f331964 100644 --- a/background.js +++ b/background.js @@ -102,6 +102,8 @@ async function restartProfiler() { await startProfiler(); } +const isWindows = navigator.platform === "Win32"; + (async () => { window.profilerState = (await browser.storage.local.get('profilerState')).profilerState;
🤦🏻♂️ That won’t work as 64‑bit Firefox returns Win64 in navigator.platform (at least until Firefox 63 is released).
See also bug 1472618.
Thanks for the hint !
This is moved here: https://bugzilla.mozilla.org/show_bug.cgi?id=1625535