New Instrumentation: Settled Promises #1198
phoddie
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use the instrumentation pane of xsbug to get a quick overview of the resources used in a running project. If there are spikes in use of a resource, it can be an early warning that some optimization may be needed. I just added "Promises settled" to instrumentation. It shows the number of promises jobs (callbacks) invoked each second. If you aren't familiar with the term "settled" as it applies to Promises, it just means a promise that been either resolved or rejected.
Here's what it looks like when running the
fetch
example:For each complete
fetch
request in the example app, 5 promises are settled. Usually these are grouped within a single second of instrumentation, but sometimes they are split as shown in the orange highlighted bar.The "Promises settled" instrumentation is available in the simulator (mcsim) and on ESP8266, ESP32, Raspberry Pi Pico, and nRF52 microcontrollers. This feature was motivated by a comment from @linfan68 who mentioned a project using "a lot" of promises. We didn't have an easy way to determine how many promises "a lot" meant. With the "Promises settled" instrumentation, now we do.
Beta Was this translation helpful? Give feedback.
All reactions