Answer the question
In order to leave comments, you need to log in
Is the code optimized if it is divided into several subprocesses in multiprocessing?
Let's say there are 100 identical functions, in which case will you get a more optimized code?
1) Divide 100 functions into 100 processes
2) Create 10 processes, where each will launch 10 subprocesses that perform functions
Answer the question
In order to leave comments, you need to log in
In general, if you divide the code into 100 processes, it will run faster than 10 processes with 10 subprocesses, but if we talk about optimization and appearance of the code, then 10 processes with 10 incoming subprocesses will look better. Appearance vs Performance?
PS you can just divide everything into 2 processes, or 4. Then it will be better.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question