Replies: 1 comment 2 replies
-
Ah that's an interesting use case. Austin is an out-of-process profiler, so it is not straight-forward to enable/disable it from a Python application. That is not to say that it is impossible though. The Something like echion provides an in-process alternative to Austin. However, this was not designed with this use case in mind, so there currently isn't a dedicated (nice) API to start/stop the profiler programmatically. However, one can work around this with from echion.bootstrap import start, stop
# Start echion
start()
...
# Stop echion
stop() Annoyingly, the configuration would have to be passed by setting environment variables for now (https://github.com/P403n1x87/echion/blob/c3c522c48cf39757b7cf95922b631663b18b38e2/echion/bootstrap/__init__.py#L33-L37), e.g. to set the output file import os
os.environ["ECHION_OUTPUT"] = "/path/to/output/file" which would be in the MOJO binary format (it can be visualised with the VS Code extension). |
Beta Was this translation helpful? Give feedback.
-
Hi,
One of my favorite things about profiling when I'm working in matlab are the
profile on
andprofile off
to really profile specific sections of code. Is there something similar in the austin ecosystem? I have a case where I'm debugging a code that has a long initialization on the first run but should be faster subsequently, but because a portion of the code is io bound, it's a little bit difficult to actually narrow down the performance without running thousands of subsequent calls. Which takes too long due to ioAny thoughts on my situation?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions