py-spy
py-spy copied to clipboard
when disable gil the result is not accuracy
even the process not running. the py-spy result would cost show too much samples:
[root@plat-sh-data-testing-common-pic-infer-demo001 test]# time py-spy record --format=raw --full-filenames --nonblocking --threads --subprocesses --pid 18018
py-spy> Sampling process 100 times a second. Press Control-C to exit.
^C
py-spy> Stopped sampling because Control-C pressed
py-spy> Wrote raw flamegraph data to '18018-2023-09-05T17:29:05+08:00.txt'. Samples: 1092 Errors: 0
py-spy> You can use the flamegraph.pl script from https://github.com/brendangregg/flamegraph to generate a SVG
real 0m3.493s
user 0m0.603s
sys 0m0.843s
[root@plat-sh-data-testing-common-pic-infer-demo001 test]# time py-spy record --format=raw --full-filenames --nonblocking --threads --subprocesses --pid 18018 --gil
py-spy> Sampling process 100 times a second. Press Control-C to exit.
^C
py-spy> Stopped sampling because Control-C pressed
py-spy> Wrote raw flamegraph data to '18018-2023-09-05T17:29:12+08:00.txt'. Samples: 0 Errors: 0
py-spy> You can use the flamegraph.pl script from https://github.com/brendangregg/flamegraph to generate a SVG
real 0m5.304s
user 0m0.095s
sys 0m0.139s