As it is written, it looks like the init function could be parallelized across each item in self.data. Would using something like multiprocessing ( multiprocessing — Process-based parallelism — Python 3.9.6 documentation 1 ) speed this up?