#JS Function execution time

1 messages · Page 1 of 1 (latest)

viscid cradle
#

Yet another FeatReq I guess 😉 -
The Logs show only basic info like JS Function executed successfully

Request to add execution time (elapsed) in ms

This is especially useful to quickly identify bottlenecks or measure performance improvements between 2 code alternatives.
Temp workaround: add explicit code for it in the function(s) - e.g. see https://stackoverflow.com/questions/313893/how-to-measure-time-taken-by-a-function-to-execute but...
this doesn't work for async functions.
For those I am using the below but would be good if handled in the Logs / debugger:

  test: async () => {
    var start = performance.now();
    await JS.myAsyncFunction();
    var stop = performance.now();
    showAlert(`${stop - start} milliseconds`);
  },
cursive fiberBOT
#

Hi There!
Thanks for reaching out to us. One of our engineers will be with you shortly.

If you are stuck with an issue/error, please help us with following information.

  1. Which version of Appsmith are you on?
  2. Provide screenshots/screen recordings of the original error/code snippet.
  3. Add details about your use case and provide steps to reproduce the issue, if
    possible.
cursive fiberBOT
#

Hi! Please feel free to create a new feature request here:
https://github.com/appsmithorg/appsmith/issues/new/choose

But do you mean that the above snippet/workaround does not work for you? Can you
share a screenshot of the error you are getting? If you use console.log, it
should display it in the Logs tab:

GitHub

GitHub is where people build software. More than 94 million people use GitHub to discover, fork, and contribute to over 330 million projects.

viscid cradle