Re: Python C API: how to mark a type as subclass of another type

2021-11-01 Thread Dieter Maurer
Marco Sulla wrote at 2021-10-31 23:59 +0100:
>I have two types declared as
>
>PyTypeObject PyX_Type = {
>PyVarObject_HEAD_INIT(&PyType_Type, 0)
>
>etc.
>
>How can I mark one of the types as subclass of the other one? I tried
>to use tp_base but it didn't work.

Read the "Python/C Api" documentation. Watch out for `tp_base`.
-- 
https://mail.python.org/mailman/listinfo/python-list


System, configuration and Python performance

2021-11-01 Thread Shaozhong SHI
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?

Regards,

David
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: System, configuration and Python performance

2021-11-01 Thread MRAB

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.

--
https://mail.python.org/mailman/listinfo/python-list


Re: System, configuration and Python performance

2021-11-01 Thread Shaozhong SHI
On Tue, 2 Nov 2021 at 00:09, MRAB  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.

Regards,

David




> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: System, configuration and Python performance

2021-11-01 Thread Shaozhong SHI
On Tue, 2 Nov 2021 at 00:20, Shaozhong SHI  wrote:

>
>
> On Tue, 2 Nov 2021 at 00:09, MRAB  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.
>
> It is checking out whether each url is valid or not.
>
>
>
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: System, configuration and Python performance

2021-11-01 Thread Chris Angelico
On Tue, Nov 2, 2021 at 11:21 AM Shaozhong SHI  wrote:
>
> On Tue, 2 Nov 2021 at 00:09, MRAB  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
-- 
https://mail.python.org/mailman/listinfo/python-list