Jun-19-2019, 12:10 PM
Hi,
I am having trouble understanding the issue with my code. (This is just a part of my project with changed names to make it the code clearer)
boolean_list later in the code is iterated over to work with based on the evaluation.
When I run my code the CPU load is rather evenly distributed between the cores to reach a maximal CPU load of approx. 30% on each core. How can I increase the CPU usage?
Because if I compare my code to the following loop:
What am I missing?
Thank you
I am having trouble understanding the issue with my code. (This is just a part of my project with changed names to make it the code clearer)
def eval(val_list, value1): prod = partial(boolean_func, value1= value1) boolean_list = pool.map(func = prod, iterable = val_list, chunksize = 50)val_list is a list of roughly 250 items und boolean_func checks if a item of val_list and value1 match to a specific "rule"
boolean_list later in the code is iterated over to work with based on the evaluation.
When I run my code the CPU load is rather evenly distributed between the cores to reach a maximal CPU load of approx. 30% on each core. How can I increase the CPU usage?
Because if I compare my code to the following loop:
boolean_list = [] for item in val_list: boolean_list.append(boolean_func(item, value1))The loop runs faster than my code although it doesn't use multiprocessing.
What am I missing?
Thank you