dariussbezyplugins for Valenced

Performance Monitor

Measures how much time each plugin takes on Discord's JavaScript thread, so you can find the ones that slow Discord down.

1.4.0 latest 24 KB Plugin

It times every patch, JSX hook, Flux event handler and module callback a plugin adds, and the timers a plugin starts from its own code, counting only the plugin's own time. Open its settings to see plugins sorted by total time or by their slowest call, tap one to see where its time goes, and copy a report. Plugins are marked slow when a call drops a frame (16 ms or more) or they keep the thread busy for over 1% of the time.

Keep it enabled and reload Discord so it starts before the other plugins. With Developer Mode on, startup times and plugin names are shown as well. Only JavaScript time is measured, not native rendering or network.

Battery per plugin

Since the phone was last unplugged, the battery used while Discord was open is split between plugins by how long each kept the JS thread busy: a plugin busy for 2% of that time gets about 2% of that battery. It is an estimate: phones only report battery use per app, and network use and the screen cannot be split per plugin. The level comes from Discord's own device state (Android and iOS). A session starts over when the phone has been charged, and the previous one is kept for comparison.

Finding what causes stalls

  • Stall analysis: when the JS thread is busy for over 100 ms, the time is split into plugin code, Discord's own Flux handling, freeing memory (garbage collection, from the engine's own counters) and the rest (React rendering, Discord's own timers, native events). It names the plugins that took most of it, and the slowest single call. The split is an estimate.
  • Timers: callbacks of setTimeout, setInterval and requestAnimationFrame started by a plugin's own code (its start, hooks or other timers) count for that plugin, so polling and delayed work show up.
  • Memory: how much JS memory Discord uses and how long freeing it took. A large share points to plugins that keep big caches or logs.
  • Hooked functions: time per hooked function and per kind (JSX hooks, patches, Flux handlers), all plugins together, so a pile-up of many plugins on one function is visible.
  • Percentiles and call type: 95% and 99% of a plugin's calls stay under a given time; hooks are flagged as heavy per call, or cheap but called very often.
  • The monitor's own cost is estimated, and light mode times only one call in ten to lower it (totals become estimates).
  • JS frames that came late are counted while the settings page is open. Only the JS side is visible: the UI thread, Reanimated and per-gesture timing cannot be seen by a plugin.
  • Saved runs: save a run with an activity label, and compare two runs, for example with all other plugins off (a baseline) against with them on.

Recent changes

  1. 1.4.0

    Battery use per plugin since you unplugged the phone (an estimate), timers and memory cleanup counted per plugin, and a memory row with advice.

Feedback about Performance Monitor

See all

Loading…

All 5 versions
VersionSize
1.4.0 latest24 KBZip
1.3.020 KBZip
1.2.018 KBZip
1.1.213 KBZip
1.0.06 KBZip