python - python 中的 ctypes 有多快?

标签 python python-2.7 ctypes

我刚刚开始研究 ctypes,对它们的工作原理有点好奇。与常规 C 实现相比,它的速度如何?我想知道在 python 程序中使用 ctypes 会加速还是减慢速度。谢谢!

最佳答案

大多数情况下没有“常规 C 实现”。 Python 数据结构的级别高出一到三个数量级。

回答你的问题“python 中的 ctypes 有多快?” - 答案是“相当快”。

查看 numpy 以了解它的想法。

关于python - python 中的 ctypes 有多快?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10543992/

相关文章:

python - 在linux下从源码安装wxPython

python - 在 Bokeh 中创建选择列表时出错

python - NLTK 荷兰语 alpino 至 英语

python - 使用 self 论证

android - Kivy 应用程序在后台(无 Gui,服务)

.net - IronPython 无法运行导入 numpy 的脚本

Python3 ctypes c_unit32 字节序

python - 在 Python 中组织列表列表

python - 从通过 ctypes 获取的 C-ptr 创建 numpy 数组

python - 如何使用 ctypes 将 Python 列表转换为 C 数组?