Using pickle slows down PyPy3.6 v7.3.1

Create issue
Issue #3175 new
Daniel Ariad created an issue

Running the code below with cpython 3.7.6 on macOS Catalina gave:
3.5014491081237793 1.3246009349822998 0.7191169261932373,
while running the code below with cpython 3.7.6 on macOS Catalina gave:
8.686806917190552 3.4107110500335693 0.04938697814941406

This means the pickle’s dump and load are much slower in Pypy3 than in cypthon.

import time, pickle
a = time.time()
A = {i:i**2 for i in range(10000000)}
with open('BUG.p' , "wb" ) as f:
pickle.dump( A, f )
b = time.time()
with open('BUG.p', 'rb') as f:
A = pickle.load(f)
c = time.time()
result = [a+b for a,b in A.items()]
d = time.time()
print(b-a,c-b,d-c)

Comments (2)

  1. Log in to comment