This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author malin
Recipients malin, methane, rhettinger
Date 2020-07-23.00:18:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1595463506.93.0.818987940091.issue41265@roundup.psfhosted.org>
In-reply-to
Content
I'm working on a patch.
lzma decompressing speed increases:

baseline: 0.275722 sec
patched:  0.140405 sec
(Uncompressed data size 52.57 MB)


The new algorithm looks like this:

    #define INITIAL_BUFFER_SIZE (16*1024)

    static inline Py_ssize_t
    get_newsize(Py_ssize_t size)
    {
        const Py_ssize_t MB = 1024*1024;
        const Py_ssize_t GB = 1024*1024*1024;

        if (size <= 1*MB) {
            return size << 2;           // x4
        } else if (size <= 128*MB) {
            return size << 1;           // x2
        } else if (size <= 1*GB) {
            return size + (size >> 1);  // x1.5
        } else if (size <= 2*GB) {
            return size + (size >> 2);  // x1.25
        } else {
            return size + (size >> 3);  // x1.125
        }
    }
History
Date User Action Args
2020-07-23 00:18:26malinsetrecipients: + malin, rhettinger, methane
2020-07-23 00:18:26malinsetmessageid: <1595463506.93.0.818987940091.issue41265@roundup.psfhosted.org>
2020-07-23 00:18:26malinlinkissue41265 messages
2020-07-23 00:18:26malincreate