Cache files that weren't accessed in the last 30 days will be automatically
garbage collected. This collection happens when the `save_module` is called
via a lock system that would make it happen only one time per day.
Change Parso to use cPickle instead of pickle when reading/writing the
cache, which speeds up the cache significantly.
In Python 2, cPickle is up to 1000 times faster than pickle. (In Python
3, if you "import pickle", you are actually getting cPickle.)
As is the convention, the code tries to import cPickle, and if that
fails, it falls back to pickle.
This has a big impact for users of jedi-vim, since in many cases Vim
uses Python 2.
Any caller of Parso can specify a cache path, and if none is specified,
parso will fall back to a default.
Parso's code to read a file from the cache handled this correctly; but
its code to write a file to the cache had a bug -- any override of the
default was ignored.
In the case of Jedi, this is a significant problem, since Jedi overrides
the default. The result is that files will be written to the cache, but
will then never be found when reading from the cache.
Change Windows default cache directory to local
From an issue that called for:
The default jedi cache directory is the roaming folder. In my company, we have restrictions on the file size of the Roaming folder (since I believe these settings are synced across computers). The jedi cache really isn't a fundamental user setting that needs to be synced across devices, so it really should be in the local app data folder. So I propose here that the default windows path use the environment variable %LocalAppData% instead.