FunctionTrace - Low overhead Python Profiler

36 views
Skip to first unread message

Thomas Passin

unread,
Nov 5, 2022, 10:16:56 AM11/5/22
to leo-editor
I stumbled upon an interesting profiler today - FunctionTrace.  It works together with Firefox so as to make use of Firefox's profiling UI, and supposedly incurs almost no slowdown while profiling.  It's currently Linux.Mac only.


I've never done any Python profiling, but this looks worth looking at, especially the second link.

Edward K. Ream

unread,
Nov 6, 2022, 7:06:05 PM11/6/22
to leo-editor
On Saturday, November 5, 2022 at 9:16:56 AM UTC-5 tbp1...@gmail.com wrote:
I stumbled upon an interesting profiler today - FunctionTrace.  It works together with Firefox so as to make use of Firefox's profiling UI, and supposedly incurs almost no slowdown while profiling.  It's currently Linux.Mac only.


Thanks for these links. The sources are here.

Edward

Edward K. Ream

unread,
Nov 7, 2022, 7:47:11 AM11/7/22
to leo-editor
> The sources [for FunctionTrace] are here.

FunctionTrace is likely a python wrapper around system tracing tools. Surely there is no way to get the performance claimed using only python (or rust).

Edward

Jacob MacDonald

unread,
Nov 7, 2022, 10:17:25 AM11/7/22
to leo-e...@googlegroups.com

Edward K. Ream

unread,
Nov 7, 2022, 2:03:20 PM11/7/22
to leo-editor
On Monday, November 7, 2022 at 9:17:25 AM UTC-6 jacc...@gmail.com wrote:

It looks to be a C extension module which uses profiling hooks built into Python

Thanks for your comments. As I read/skim the code, the magic must be elsewhere, that it, in the code that calls the callbacks. Imo, that code must be very low level (system/compiler dependent) code. But of course I could be mistaken.

Many years ago there was a unix tool called (iirc) systrace. That tool might have evolved into the Android systrace tool, but if so it has evolved considerably.

Edward
Reply all
Reply to author
Forward
0 new messages