Gecko-Profiler-Addon icon indicating copy to clipboard operation
Gecko-Profiler-Addon copied to clipboard

Default to an interval of 2ms on Windows

Open mstange opened this issue 9 years ago • 5 comments

Because that's the smallest effective resolution we're getting there.

mstange avatar Apr 15 '17 00:04 mstange

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

clarkbw avatar May 08 '17 17:05 clarkbw

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() {
     }
   });
 })();

clarkbw avatar May 08 '17 18:05 clarkbw

(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.

ExE-Boss avatar Sep 04 '18 04:09 ExE-Boss

Thanks for the hint !

julienw avatar Sep 04 '18 10:09 julienw

This is moved here: https://bugzilla.mozilla.org/show_bug.cgi?id=1625535

gregtatum avatar Mar 27 '20 18:03 gregtatum