Long running process - how to speed up?

Kirill Ratkin kvratkin at yandex.ru
Sat Feb 19 07:13:57 EST 2022


Hi,

How I understand your script starts another script and should wait until 
second one completes its job. Right?

If so you have several options depend on how your first script is written.

If your script is async then ... there is good asyncio option

proc = await asyncio.create_subprocess_shell(
f"{execcmd}{execargs}", stdin=None, stdout=None
)
await proc.wait() In this way you can starn many workers and you don't neet to wait then in sync manner.


Anyway, just please give more info about what problem you face.

19.02.2022 14:28, Shaozhong SHI пишет:
> I have a cvs file of 932956 row and have to have time.sleep in a Python
> script.  It takes a long time to process.
>
> How can I speed up the processing?  Can I do multi-processing?
>
> Regards,
>
> David


More information about the Python-list mailing list