Live data from Hacker News

FunctionTrace: Graphical Python Profiler

functiontrace.com

11–20 of 33 posts

Re: FunctionTrace: Graphical Python Profiler

#11

Is there something about the actual profiler that differs from existing tools like pyinstrument [1] or py-spy [2]? I know pyinstrument has various output options and I wonder if it could potentially output something readable by the Firefox Profiler tool. [1] : https://github.com/joerick/pyinstrument [2] : https://github.com/benfred/py-spy

It uses FEE (function entry/exit) tracing so it generates a full execution trace of all functions called during your run like “History” [1], the C/C++ tracing profiler it was based on.

You can then post-process that trivially to get low resolution aggregate information like normal statistical/sampling profilers generate.

[1] https://www.ghs.com/products/MULTI_IDE.html

Re: FunctionTrace: Graphical Python Profiler

#12
post #7
post #4

The license is a bit perplexing at https://gitlab.com/mbryant/functiontrace/-/blob/master/LICEN... It says it is licensed under Apache License 2.0, but also under "Prosperity Public License 3.0.0" which limits use for a commercial purpose to 30 days.

I don't see any pricing page or anything. So if I'm a business and after the 30 days decide I'm sold on it, what exactly do I do?

The website (https://functiontrace.com/) mentions that dual licensing is available at the bottom of the page, so my best guess would be that you need to contact the author for pricing details.

Re: FunctionTrace: Graphical Python Profiler

#13
post #11

Is there something about the actual profiler that differs from existing tools like pyinstrument [1] or py-spy [2]? I know pyinstrument has various output options and I wonder if it could potentially output something readable by the Firefox Profiler tool. [1] : https://github.com/joerick/pyinstrument [2] : https://github.com/benfred/py-spy

It uses FEE (function entry/exit) tracing so it generates a full execution trace of all functions called during your run like “History” [1], the C/C++ tracing profiler it was based on. You can then post-process that trivially to get low resolution aggregate information like normal statistical/sampling profilers generate. [1] https://www.ghs.com/products/MULTI_IDE.html

compare to pyspy, which is out of process and reads process memory to reconstruct stack frames as a sampler, which means marginal overhead for the program, re safer to use in prod. it would be interesting to see a function entry/exit on linux via epbf attached to USDT.

Re: FunctionTrace: Graphical Python Profiler

#14
post #7

Earlier quoted context omitted.

I don't see any pricing page or anything. So if I'm a business and after the 30 days decide I'm sold on it, what exactly do I do?

The website ( https://functiontrace.com/ ) mentions that dual licensing is available at the bottom of the page, so my best guess would be that you need to contact the author for pricing details.

ah, that makes sense. Thanks!

Re: FunctionTrace: Graphical Python Profiler

#15
post #13
post #11

Earlier quoted context omitted.

It uses FEE (function entry/exit) tracing so it generates a full execution trace of all functions called during your run like “History” [1], the C/C++ tracing profiler it was based on. You can then post-process that trivially to get low resolution aggregate information like normal statistical/sampling profilers generate. [1] https://www.ghs.com/products/MULTI_IDE.html

compare to pyspy, which is out of process and reads process memory to reconstruct stack frames as a sampler, which means marginal overhead for the program, re safer to use in prod. it would be interesting to see a function entry/exit on linux via epbf attached to USDT.

They claim tracing overhead is I assume the hooks Python makes available are probably just kind of bad for this use case and they do not have access to a proper high speed log.

Re: FunctionTrace: Graphical Python Profiler

#17

If I'm understanding this correctly you need to use Cargo to install part of this. That makes it a lot harder to start using as someone in the Python ecosystem (who is not also in the Rust ecosystem)

Python packaging is painful.

They will probably get a build system going so wheels can be used eventually.

Re: FunctionTrace: Graphical Python Profiler

#19
post #15
post #13

Earlier quoted context omitted.

compare to pyspy, which is out of process and reads process memory to reconstruct stack frames as a sampler, which means marginal overhead for the program, re safer to use in prod. it would be interesting to see a function entry/exit on linux via epbf attached to USDT.

They claim tracing overhead is I assume the hooks Python makes available are probably just kind of bad for this use case and they do not have access to a proper high speed log.

Yeah, it tends to be low single digit percents, but you can get some pessimal behavior if you have enough tiny functions because the overhead of what Cpython exposes starts becoming large. Our "benchmark" where the 10% comes from is tensorflow, which is overwhelmingly tiny functions and no sustained io/individual functions.
Post reply on HN