Skip to content

Edge-Drop is a clipboard shelf on the edge of your screen. Hover to open it. Drag files and images into any app, click to copy text and links. Free and open-source for Windows.

perf(power): tune adaptive cursor polling and remove V8 optimize-for-size flag

Deepender251eb401a99ce2
diff --git a/electron/main/index.ts b/electron/main/index.ts
index 946ae1f..0959173 100644
--- a/electron/main/index.ts
+++ b/electron/main/index.ts
@@ -34,9 +34,6 @@ app.disableHardwareAcceleration()
// Restrict the renderer to a single webContents and forbid remote module usage.
app.enableSandbox()
-// Optimize V8 heap allocation and garbage collection for low RAM overhead.
-app.commandLine.appendSwitch('js-flags', '--max-old-space-size=128 --optimize-for-size')
-
// ---- single instance -------------------------------------------------------
const gotLock = app.requestSingleInstanceLock()
if (!gotLock) {
diff --git a/electron/main/window.ts b/electron/main/window.ts
index 6c0cd42..99e9152 100644
--- a/electron/main/window.ts
+++ b/electron/main/window.ts
@@ -124,15 +124,15 @@ export function setPreviewMode(active: boolean): void {
*/
/** Proximity threshold for entering fast-poll mode (px from the edge). */
-const FAST_POLL_PROXIMITY_PX = 250
+const FAST_POLL_PROXIMITY_PX = 450
/** Full-speed poll when edge is near. */
const POLL_FAST_MS = 16
/** Battery-power slow poll (panel closed, cursor far). */
-const POLL_SLOW_BATTERY_MS = 180
+const POLL_SLOW_BATTERY_MS = 100
/** AC-power slow poll (panel closed, cursor far). */
-const POLL_SLOW_AC_MS = 120
+const POLL_SLOW_AC_MS = 75
/** After leaving proximity, stay in fast mode for this long before throttling. */
-const SLOW_COOLDOWN_MS = 800
+const SLOW_COOLDOWN_MS = 1500
let cursorPollTimer: ReturnType<typeof setInterval> | null = null
let heartbeatTimer: ReturnType<typeof setInterval> | null = null