python3 和 python3m 可执行文件的区别 [英] Difference between python3 and python3m executables
问题描述
/usr/bin/python3
和 /usr/bin/python3m
可执行文件有什么区别?
我正在 Ubuntu 13.04 上观察它们,但 Google 建议它们也存在于其他发行版中.
这两个文件的md5sum是一样的,但是好像不是符号链接或者硬链接;这两个文件具有由 ls -li
返回的不同 inode 编号,并且测试 find -xdev -samefile/usr/bin/python3.3
不会返回任何其他文件.>
有人问了一个 关于 AskUbuntu 的类似问题,但我想了解更多关于这两个文件.
感谢 chepner 指出我已经有了解决方案的链接.
<块引用>Python 实现可以在文件名中包含额外的标志适当标记.例如,在 POSIX 系统上,这些标志将也有助于文件名:
--with-pydebug (flag: d)
--with-pymalloc (flag: m)
--with-wide-unicode (flag: u)
通过PEP 3149.
特别是关于 m
标志,这就是 Pymalloc 的含义:
Pymalloc,一个由 Vladimir 编写的专门的对象分配器Marangozov,是添加到 Python 2.1 的一个特性.Pymalloc 旨在比系统 malloc() 更快并且内存开销更少用于典型的 Python 程序分配模式.分配器使用C 的 malloc() 函数获取大内存池然后实现来自这些池的较小内存请求.
通过 Python 2.3 中的新功能>
最后,这两个文件在某些系统上可能是硬链接的.虽然这两个文件在我的 Ubuntu 13.04 系统上具有不同的 inode 编号(因此是不同的文件),但 两年前的comp.lang.python 帖子 表明它们曾经是硬链接的.
What is the difference between the /usr/bin/python3
and /usr/bin/python3m
executibles?
I am observing them on Ubuntu 13.04, but Google suggests that they exist on other distributions too.
The two files have the same md5sum, but do not seem to be symbolic links or hard links; the two files have different inode numbers returned by ls -li
and testing find -xdev -samefile /usr/bin/python3.3
does not return any other files.
Someone asked a similar question on AskUbuntu, but I wanted to find out more about the difference between the two files.
Credit for this goes to chepner for pointing out that I already had the link to the solution.
Python implementations MAY include additional flags in the file name tag as appropriate. For example, on POSIX systems these flags will also contribute to the file name:
--with-pydebug (flag: d)
--with-pymalloc (flag: m)
--with-wide-unicode (flag: u)
via PEP 3149.
Regarding the m
flag specifically, this is what Pymalloc is:
Pymalloc, a specialized object allocator written by Vladimir Marangozov, was a feature added to Python 2.1. Pymalloc is intended to be faster than the system malloc() and to have less memory overhead for allocation patterns typical of Python programs. The allocator uses C's malloc() function to get large pools of memory and then fulfills smaller memory requests from these pools.
Finally, the two files may be hardlinked on some systems. While the two files have different inode numbers on my Ubuntu 13.04 system (thus are different files), a comp.lang.python post from two years ago shows that they once were hardlinked.
这篇关于python3 和 python3m 可执行文件的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!