[Distutils] For maximum performance, Python packages are best installed as zip files.

Donald Stufft donald at stufft.io
Mon Apr 11 07:33:05 EDT 2016


> On Apr 11, 2016, at 7:23 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> 
> On Mon, 11 Apr 2016 07:08:19 -0400
> Donald Stufft <donald at stufft.io> wrote:
>> 
>> I’m not sure if that is still the case with modern SSDs, but I think the idea is that by putting everything inside of zip files you reduce the number of stat calls that Python needs to do (they flip side of this is that pkg_resources is incredibly slow because it needs to issue a ton of stat calls on import).
> 
> I don't think SSDs have anything to do in it since the kernel should
> cache directory contents, rather it's the number of system calls issued.
> But as Paul says, in Python 3 importlib got a lot of optimization work
> on this front, so this advice probably doesn't apply anymore.
> 

Surely SSDs are faster at returning the data (metadata or actual data) than spinning rust and thus would speed up importing on their own. Sure you might have that data cached in memory if you’ve recently accessed it, but you just as easily might not have that data cached and the OS might need to hit the disk to find out.


-----------------
Donald Stufft
PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20160411/0f1be7cc/attachment-0001.sig>


More information about the Distutils-SIG mailing list