twibiral/obsidian-execute-code

Request for a Python Code Profiling Feature

Opened this issue · 1 comments

I'm currently looking for a way to automatically measure the execution time of Python code, particularly on a block-by-block basis. I've explored tools like timeit, perf, richbench, and hyperfine, but I encountered limitations such as not being able to easily inject code at the end of the target code or not effectively handling arguments with -m or -mod.

Among these tools, hyperfine seems to be the most promising one, but it lacks the ability to display the results conveniently.

I'm looking for an alternative solution or enhancement to existing tools that allows measuring the execution time of Python code blocks, supports injecting code both before and after the target code, and handles arguments effectively, especially with -m and -mod options.

Expected Behavior:

  • Ability to measure Python code execution time on a block-by-block basis.
  • Support for injecting code both before and after the target code.
  • Effective handling of command-line arguments, including -m and -mod options.
  • Convenient display of profiling results.

Additional Information:
I believe that having such a feature or tool would greatly benefit Python developers and help in optimizing code performance.

Thank you for considering this feature request.

Hi, that's a neat idea! I think we can implement it easily in TypeScript so that it automatically works for all supported languages.