Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Performance / crash when ~/Documents folder contains lot of files / folders #405
Check this topic. How to reproduce?
Same issue has dgelessus and shaun-h. Shaun has even worse issue, crash, ... and I assume it's because it consumes all memory on his device?
Trying to simulate crash, not happened yet, but this ...
#!python3 import os import shutil ROOT = os.path.expanduser('~/Documents/tree') COUNT = 100 MAX_DEPTH = 3 def make_dirs(parent, depth=0): if depth == MAX_DEPTH: return if depth <= 3: print(parent, depth) for i in range(0, COUNT): dir = os.path.join(parent, str(i)) os.mkdir(dir) make_dirs(dir, depth + 1) try: shutil.rmtree(ROOT) except: pass os.mkdir(ROOT) make_dirs(ROOT)
... and + - New Folder takes 1m21s to display folder tree.
There's no crash report, just lot of events of cpu usage type ...
... but, these lines ...
... and full mess around them ...
... are interesting. That's new, AFAIK, there was an OOM crash when app did consume lot of memory. Maybe something new, no idea. Anyway, killed by the system.
P.S. Great times few years ago when devs were not putting stupid messages about not animating wallpaper into the system log :( How is anyone supposed to find anything in this mess? :(
referenced this issue
Oct 21, 2017
It's not about ~/Documents only, but all other folders as well (file sharing, ...). I think that attention to this one should be increased little bit, because people can open whole folders with lot of files and Pythonista needs some optimisation, folders/files lazy loading, ... Something similar to this one I made for BM and Drag & Drop script to make it fast (just an example what I mean).