M2 Profiler
Here’s a FlameGraph visualization for the output of a M2 profiler that I’ve implemented:
Guide
- Build Macaulay2 using CMake.
- Enable profiling, by running
cmake -DPROFILING=ON .
in the build directory. - Run the test or script you would like to profile.
- Locate the raw profiling data file named
profile-$PID.raw
. - Run
ninja profile
; when asked, enter the name of the profiling data file. - A FlameGraph should automatically open. If not, open
profile-$PID.raw.html
in a browser.
Ideas
- https://v8.dev/docs/profile
- https://v8.dev/docs/gdb-jit
- https://v8.dev/docs/stack-trace-api
- https://github.com/jrfonseca/gprof2dot
- https://www.graphviz.org/doc/info/lang.html
- https://docs.julialang.org/en/v1/manual/profile/