quickjs icon indicating copy to clipboard operation
quickjs copied to clipboard

Add an option to output profiling/coverage info

Open mingodad opened this issue 2 years ago • 2 comments

Add an option to output profiling/coverage info (basically function calls count and clock_t time spent).

There is an option to define how many samples to use with the definition of compile time macro "PROFILE_CALLS_SAMPLE" the default value is 10. The code is guarded by a compile time macro "CONFIG_PROFILE_CALLS", to build execute "make CONFIG_PROFILE_CALLS=1". When using the added option "-p" we can repeat it up to 3 times:

  • "-p" -> Only update calls count and omit functions with 0 calls
  • "-p -p" -> Update calls count and sampled time_spent and omit functions with 0 calls
  • "-p -p -p" -> Like the above but showing functions with 0 calls. The output format: =[ code_line call_count acumulated_time_spent average_time_spent function_name ] [454 2 1 6 xfillArr]

mingodad avatar Jun 06 '23 12:06 mingodad

Pull requests are not accepted. Use the mailing list to submit patches.

paulocoghi avatar Oct 09 '23 15:10 paulocoghi

But I think that's a good idea to also post it here so other people can see it in an easy to use way.

mingodad avatar Oct 09 '23 17:10 mingodad