Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Am I using correctly scalene profiler for python code?

I'm trying to use Scalene to profile some python code. When I run:

scalene --reduced-profile --html --outfile ./profiling/profile_name_file.html ./profiling/profiling_script.py

I get two error messages:

[1205/174847.087563:ERROR:elf_dynamic_array_reader.h(64)] tag not found [1205/174847.110144:ERROR:directory_reader_posix.cc(42)] opendir /home/user/.config/google-chrome/Crash Reports/attachments/82a5951a-f981-4d23-badc-a9487b65f7c0: No such file or directory (2)

Afterwards, I go to the directory from which I ran the bash command, and I find a profile.html, instead of a profile_name_file.html inside the profiling folder.

When I open that html file, the graphs look very odd. enter image description here

like image 798
An old man in the sea. Avatar asked Oct 24 '25 08:10

An old man in the sea.


1 Answers

Yes you are using the correct profiler. As documented here the timeline is visualized as sparklines, which are small line charts. You might consider looking at CLI output (see below) or scaling the workload of profiling_script.py as Scalene can only profile code that runs for at least one second or allocates at least 10MB.

CLI output

like image 164
Lierre Avatar answered Oct 25 '25 22:10

Lierre