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 catalin.iacob
Recipients Goplat, brett.cannon, catalin.iacob, eric.snow, serhiy.storchaka, ysj.ray
Date 2012-11-25.15:41:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1353858060.67.0.23605694509.issue8745@psf.upfronthosting.co.za>
In-reply-to
Content
I tried Serhiy's suggestion in msg174934, see attached attempt-fseek-seek_cur.patch updated to current default. It makes no difference relative to the default branch for my test stdlib.zip, dummy reads still work better on Windows.

This makes sense if you follow the CRT's implementation, fseek calls _fseek_nolock which always calls _flush, regardless whether SEEK_CUR is used or not. This is the case with both VS2008 and VS2010. So this patch is a workaround for poor fseek performance in Microsoft's CRT, it doesn't cause performance issues on Linux but saves quite some milliseconds of startup time so I think it's worth the tradeoff.

I'll also upload zipimport_speedup-v3.patch updated to apply to current default and with error handling for failing freads since the fseeks that the patch replaces have gained error handling on the default branch in the mean time. The timings remain the same on my Windows machine: around 30ms for default branch, around 15ms with patch.
History
Date User Action Args
2012-11-25 15:41:00catalin.iacobsetrecipients: + catalin.iacob, brett.cannon, ysj.ray, Goplat, eric.snow, serhiy.storchaka
2012-11-25 15:41:00catalin.iacobsetmessageid: <1353858060.67.0.23605694509.issue8745@psf.upfronthosting.co.za>
2012-11-25 15:41:00catalin.iacoblinkissue8745 messages
2012-11-25 15:41:00catalin.iacobcreate