Why is my CPU load is only at 25% when using Python?

xfixkdsab report abuse

I wrote a Python script which takes a long time to run. I checked how much is my system loaded while the script is running and discovered that Python process takes only 25% of the CPU. How can I allow Python to use more of the CPU to work faster?

Answers

rEvee750 report abuse

Looks like you've got a 4-core processor. By default, in Python processes run on just one processor(100/4 = 25%). If you want to enable the use of more than one core you should check out multiprocessing Python module.

donnY954 report abuse

You are using only one core. I would recommend checking out Parallel Python (https://www.parallelpython.com/) which enables parallelizm. From their website: "It is light, easy to install and integrate with other python software."

Add Answer

Need support?

Just drop us an email to ... Show more