[Python-Dev] PEP 364, Transitioning to the Py3K standard library
Barry Warsaw
barry at python.org
Thu Mar 8 00:45:10 CET 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Mar 7, 2007, at 5:46 PM, BJörn Lindqvist wrote:
>> When Python's import machinery is initialized, the oldlib package is
>> imported. Inside oldlib there is a class called ``OldStdlibLoader``.
>> This class implements the PEP 302 interface and is automatically
>> instantiated, with zero arguments. The constructor reads all the
>> ``.mv`` files from the oldlib package directory, automatically
>> registering all the remappings found in those ``.mv`` files. This is
>> how the Python 2.x standard library is remapped.
>
> Will not reading all those .mv files add a lot of overhead? Disk seeks
> is not cheap.
I don't think so. There will likely be just a few .mv files in the
stdlib and they'd all get loaded at Python startup time. A
package's .mv file would only get loaded when the package gets
imported. Once read I don't think we'd need to stat for those or
read them again.
It would definitely be worth measuring, but my guess is the
additional overhead will be negligible.
- -Barry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iQCVAwUBRe9OhnEjvBPtnXfVAQLjYAP7BeVkCMGCVeVt/oqIoywtyP1+B4Ndgmdo
uj0JQUSmu2ikRXRoSNtNSoSKdQsco9FI+LHYHwBRJmLKC+IIZ0glP/y+re6hkdOa
vWfj1QLYBzWY6EzXRgf92xiR9dXJx92vsiSWAjibRwLlE7d+3eFYqrBa+fvEzQGv
pkKjOlTYIKo=
=5OL3
-----END PGP SIGNATURE-----
More information about the Python-Dev
mailing list