我剛開始研究ctypes,對它們的工作原理有點好奇。它如何比較速度明智的常規C實施?在python程序中使用ctypes加速或減慢它基本上是我想知道的。謝謝!python中的ctypes有多快?
1
A
回答
1
大多數情況下沒有「常規C實現」。 Python數據結構是一個到三個數量級的更高級別。
回答你的問題「python中ctypes有多快?」 - 答案是「非常快」。
看看numpy的想法吧。
0
如果只考慮速度,不要使用Python,PHP,Perl或其他腳本語言。用C或Assembly編寫任何內容。由於這些腳本語言的速度足以構建谷歌,Facebook和亞馬遜,你會發現它們足夠快,無論你在想什麼。
相關問題
- 1. python中的ctypes lib
- 2. ctypes純python vs ctypes django
- 3. Python:使用ctypes的多維數組?
- 4. ctypes vs純python
- 5. python gdb和ctypes
- 6. ctypes python std :: string
- 7. python ctypes數組
- 8. Python Ctypes&Threading
- 9. Python,ctypes和mmap
- 10. Python的CTypes _argtypes沒有from_params方法
- 11. 在Python ctypes中使用array.array
- 12. 將ctypes數組轉換爲python列表的更快方法?
- 13. 的Python ctypes的addressof CFUNCTYPE
- 14. Python mmap ctypes - 只讀
- 15. Windows WlanApi和Python Ctypes
- 16. python ctypes - wrap void pointer
- 17. Python ctypes發生器
- 18. 嵌套的Python生成器有多快?
- 19. Python Ctypes奇怪的行爲
- 20. python(ctypes)的Blob對象,C++
- 21. python ctypes中的多維char數組(字符串數組)
- 22. 爲什麼矩陣乘numpy的速度要快於Python中的ctypes?
- 23. python ctypes中的未知數組長度
- 24. SSE4a與Python中的ctypes? (GCC __builtin_popcount)
- 25. 在virtualenv中導入Python的ctypes錯誤
- 26. 返回使用ctypes的Python中
- 27. ctypes的netsnmp多處理
- 28. SQLite通過Python速度有多快
- 29. 有使用ctypes在Python中嵌入Lua的庫嗎?
- 30. Ctypes - 從使用ctypes的python代碼獲取C backtrace
這是如此依賴程序,這是無法回答。如果你有C語言的代碼,並且希望添加Pyhton使其更快,那麼答案是否定的。 –