Answer the question
In order to leave comments, you need to log in
CPU idle due to interpreter?
Hello!
I just can’t put it in my head who doesn’t have time to process the recursion of a terrible algorithm. Python or my processor.
On board:
Intel® Core™ i7-6900K Processor
At startup:
def fib(n):
if n <= 1:
return n
else:
return fib(n-1)+fib(n-2)
Answer the question
In order to leave comments, you need to log in
Not every task can be parallelized. If possible, then you should look at one of these libraries https://docs.python.org/3/library/threading.html and https://docs.python.org/3.6/library/multiprocessin... I would look in the direction of multiprocessing, since multithreading in python is terribly slow due to blocking by threads of each other, 100% of the processor cannot be squeezed out on threads, you can google this problem.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question