Python manager.dict() is very slow compared to regular dict

前端 未结 2 2177
悲&欢浪女
悲&欢浪女 2021-02-14 09:36

I have a dict to store objects:

jobs = {}
job = Job()
jobs[job.name] = job

now I want to convert it to use manager dict because I want to use m

2条回答
  •  一生所求
    2021-02-14 10:11

    If you are using mgr.dict() inside a loop in your pool. You can use a local normal dict to store results temporarily and then update your mgr.dict() outside the loop like your_mgr_dict.update(local_dict)

提交回复
热议问题