Mailing List Archive

Script profiling details
I am trying to track down a slow script startup time. I have executed the
script using `python -m cProfile -o profile /path/script.py` and read through
the results, but the largest culprit only shows various built-ins.

I expected this given the implementation, but I was hoping to get some
finer details so I can track down the specific module or at least the specific
file so I have a place to start reviewing code for optimizations.

Is there something I can use to analyze the existing profile output or to generate
it with more feedback?

Thanks,
jlc
--
https://mail.python.org/mailman/listinfo/python-list
Re: Script profiling details [ In reply to ]
S

> On 10 Jan 2022, at 19:29, Joseph L. Casale <jcasale@activenetwerx.com> wrote:
>
> ?I am trying to track down a slow script startup time. I have executed the
> script using `python -m cProfile -o profile /path/script.py` and read through
> the results, but the largest culprit only shows various built-ins.
>
> I expected this given the implementation, but I was hoping to get some
> finer details so I can track down the specific module or at least the specific
> file so I have a place to start reviewing code for optimizations.
>
> Is there something I can use to analyze the existing profile output or to generate
> it with more feedback?

Read the profile analyses docs/code and report using options that show you which callers are using the builtins.

If you need details reply and I will look at the scripts I use that produce a number of report types,

Barry
>
> Thanks,
> jlc
> --
> https://mail.python.org/mailman/listinfo/python-list
>

--
https://mail.python.org/mailman/listinfo/python-list
Re: Script profiling details [ In reply to ]
Hi Joseph,
**
Did you try scalene profiler?
Recently I solved a similar problem and scalene really helped me.
**
It creates a well-formed HTML report, and you can optionally
enable/disable report about
a code outside your project, for example - standard library.
**
Here it is - [1]https://pypi.org/project/scalene/
**
10.01.2022, 22:28, "Joseph L. Casale" <jcasale@activenetwerx.com>:

I am trying to track down a slow script startup time. I have executed
the
script using `python -m cProfile -o profile /path/script.py` and read
through
the results, but the largest culprit only shows various built-ins.

I expected this given the implementation, but I was hoping to get some
finer details so I can track down the specific module or at least the
specific
file so I have a place to start reviewing code for optimizations.

Is there something I can use to analyze the existing profile output or
to generate
it with more feedback?

Thanks,
jlc

--
[2]https://mail.python.org/mailman/listinfo/python-list

References

Visible links
1. https://pypi.org/project/scalene/
2. https://mail.python.org/mailman/listinfo/python-list
--
https://mail.python.org/mailman/listinfo/python-list
Re: Script profiling details [ In reply to ]
Joseph L. Casale wrote at 2022-1-10 18:43 +0000:
> ...
>I expected this given the implementation, but I was hoping to get some
>finer details so I can track down the specific module or at least the specific
>file so I have a place to start reviewing code for optimizations.
>
>Is there something I can use to analyze the existing profile output or to generate
>it with more feedback?

You might try `py-spy`.
--
https://mail.python.org/mailman/listinfo/python-list
RE: Script profiling details [ In reply to ]
> You might try `py-spy`.

That worked well, I started trying to get more data from the profile
output with the stats module but didn't quite get there.

Thank you everyone,
jlc
--
https://mail.python.org/mailman/listinfo/python-list