(this issue related to Hg
Why I suggest that don't pack internal data?
- It slow down the compiling more or less, while memory is cheap in most environments.
- If a user doesn't have huge patterns, the extra memory usage is insignificant.
- If a user has huge patterns, he/she probably will benefit from pickle fast-load, memory usage is not the principal contradiction.
- It doesn't break the compatibility of existing pickled data.
I compiled 156 common patterns, then dump them to a file, the file size is only 46 KB, so I guess memory usage is not a big problem for most users.
BTW, please add this feature to document, so that more people will know it.
FYI, compiled a huge pattern with 800,000 branches, then observe the process memory: 339.8 MB regex 2016.03.31, without pickle ability of compiled pattern. 412.0 MB regex 2016.04.01, with pickle ability, don't pack. 348.6 MB regex 2016.04.02, with pickle ability, pack.