[issue30476] Add _GenerateCRCTable() to zipfile.py to pre-compute CRC Table

2017-05-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: After some investigations this idea no longer looks good to me. The table of 256 32-bit integers will take at least 44 lines. This is too large. It is easier to check the algorithm than all these numbers. The error even in one digit can break all, but for te

[issue30476] Add _GenerateCRCTable() to zipfile.py to pre-compute CRC Table

2017-05-26 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-b

[issue30476] Add _GenerateCRCTable() to zipfile.py to pre-compute CRC Table

2017-05-26 Thread Shubha Ramani
Shubha Ramani added the comment: This is not needed after all jkloth explained. Please feel free to close. -- ___ Python tracker ___ _

[issue30476] Add _GenerateCRCTable() to zipfile.py to pre-compute CRC Table

2017-05-26 Thread Jeremy Kloth
Jeremy Kloth added the comment: See bpo-10030 (and pr #550). It removed that function in favor of the current approach. Also, that current code does not generate *every* time, but just once. Note that the computed value is stored in a global cache. -- nosy: +jkloth

[issue30476] Add _GenerateCRCTable() to zipfile.py to pre-compute CRC Table

2017-05-26 Thread Shubha Ramani
Shubha Ramani added the comment: It looks like _GenerateCRCTable() is already implemented here: https://svn.python.org/projects/python/trunk/Lib/zipfile.py The question is, why isn't it implemented here ? https://github.com/python/cpython/blob/master/Lib/zipfile.py -- ___

[issue30476] Add _GenerateCRCTable() to zipfile.py to pre-compute CRC Table

2017-05-25 Thread Shubha Ramani
New submission from Shubha Ramani: It is wasteful to generate the CRC Table every time, via _crctable = list(map(_gen_crc, range(256))). Better to have a pre-computed table. I will submit the patch which incorporates this feature along with micro-benchmark results. Related issue: http://bugs.