opening and closing many files is slow on pypy3
Another thing that's quite slow in pypy3 is opening and closing many files:
import sys import time def main(): t1 = time.time() for i in range(int(sys.argv)): with open(__file__, "r") as f: pass t2 = time.time() print(t2 - t1) if __name__ == '__main__': main()
about 4x slower than cpython for me (not a problem on pypy2), most of the time is spent in the gc.
I think the
_io module is missing a call to