Python, using multiprocess is slower than not using it
问题 After spending a lot of time trying to wrap my head around multiprocessing I came up with this code which is a benchmark test: Example 1: from multiprocessing import Process class Alter(Process): def __init__(self, word): Process.__init__(self) self.word = word self.word2 = '' def run(self): # Alter string + test processing speed for i in range(80000): self.word2 = self.word2 + self.word if __name__=='__main__': # Send a string to be altered thread1 = Alter('foo') thread2 = Alter('bar')