System, configuration and Python performance

Chris Angelico rosuav at gmail.com
Mon Nov 1 20:23:47 EDT 2021


On Tue, Nov 2, 2021 at 11:21 AM Shaozhong SHI <shishaozhong at gmail.com> wrote:
>
> On Tue, 2 Nov 2021 at 00:09, MRAB <python at mrabarnett.plus.com> wrote:
>
> > On 2021-11-01 23:02, Shaozhong SHI wrote:
> > > How to configure to improve Python performance in a system like the
> > > following:
> > >
> > > Windows 10
> > >
> > > System
> > >
> > > Processor Intel(R) Core(TM) i7-9700 CPU @3.60GHz, 3.60 GHz
> > > Installed memory (RAM) 32.0 GB (31.8 GB usable)
> > > System type: 64-bit Operating System, x64-based processor
> > >
> > > I found that the Python script was runnig slowly and wanted to find out
> > > what is going on and what activities it is doing.
> > >
> > > I opened the Task Manager and found that there is not much CPU usage.
> > >
> > > Do I need to do something like configuration to improve Python's
> > > performance?
> > >
> > If CPU usage is low, then that isn't the cause of the slowness.
> >
> > What about disk usage?
> >
> > What about network usage?
> >
> > If it's communicating across the internet, then it might be waiting for
> > the other end. If that's the case, then there's probably not much you
> > can do about it.
> >
>
> Both disk usage and network usage are very low as well.
>
> It is checking out responses of internet pages with given URLs.
>

That's almost certainly waiting for the server, then. There's nothing
you can do - in Python or any other language - to speed that up.

What you MAY be able to do is parallelize - do multiple requests at
once - but not all servers will let you hammer them.

ChrisA


More information about the Python-list mailing list