Python Forum
CPU load at approx. 30% when multiprocessing
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CPU load at approx. 30% when multiprocessing
#2
Hi,

first, multiprocessing is no guarantee that something runs faster. It is very likely to run faster on CPU bound problems, but not always.

The time per process per CPU is set by the underlaying OS. Thus, if you want your processes to have more CPU-time, you need to give them a higher priority from the OS side.

Second, multiprocessing creates some overhead setting up the processes, thus of the overall process run relatively short, multiprocessing may be slower due to that.

Third, the chunksize may be unfavorably chosen.

What are the actual run times of our code?

By the way: eval is a bad name for a function, as it overrides the build-in function eval?. Which may have very "funny" side effects. Better change the name of your function.

Regards, noisefloor
Reply


Messages In This Thread
RE: CPU load at approx. 30% when multiprocessing - by noisefloor - Jun-19-2019, 12:21 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020