本文介绍了是一个“真实的” C-Python可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我理解标准的Python发行版被认为是C-Python的。 Howerver,目前的C-Python实际上是C和Python实现的组合。 Windows版本的Python发行版中包含大约2000个Python文件 。我不确定 在C中实现了多少C-Python,但我认为在C中实现的模块越多,性能越好,内存越低足迹。 我想知道是否有可能完全(或在 $ b)使用Python就像在PHP中实现的一样,大多数情况下是$ b,就像PHP一样 - 我认为 这就是PHP获得性能优势的地方。或许我错了 ,因为重要的核心模块已经在C和那些Python 文件中真的是一个思考包装器。无论如何,如果Python 具有类似于Java的性能,两者都是解释语言,那将是理想的。 Jack 解决方案 证明它。 ;-) 严重的是,切换到更多的C代码会导致开发陷入困境,因为Python比C语言更容易编写。 你能否提供一些证据表明Python比Java或PHP慢? - Aahz( aa**@pythoncraft.com)< * http://www.pythoncraft.com/ 打字很便宜。思考很昂贵。 --Roy Smith 用C编写所有内容可能是可能的 - 但这是一项艰巨的任务。不是 结果合理。无论标准库在何处使用,都可以使用Python的灵活性,但是,如果确实有任何 的性能提升,那将是值得怀疑的。 但真正值得怀疑的是所谓的性能优势 - 你如何支持它?根据众所周知的(肯定是有限的)计算机语言枪战 http://shootout.alioth.debian.org/gp...t=all&lang=all Python比PHP快大约25%。当然,这只是一个 基准,与现实生活相关性有问题。但是你从哪里得到 那个PHP的印象比Python更快? diez 证明一下。 ;-) 我想这是主观的:) - 这就是我的经验感觉 开发的Web应用程序Python和PHP。我无法在网上找到直接的比较。 我明白。用Python实现的Python模块 - 这就是如何使用Python获得真正丰富的库。 你能否提供一些证据表明Python比Java或PHP慢? 我认为你可以在网上找到的大多数Java-Python基准测试表明,Java的速度要快3到10倍。一些在这里: http: //mail.python.org/pipermail/pyt...ry/125789.html http://blog.snaplogic.org/?p=55 这是一篇显示新版本的文章在某些方面,Ruby比Python快了(他们正在追赶:) http://antoniocangiano.com/2007/11/2...s-python-away/ I understand that the standard Python distribution is consideredthe C-Python. Howerver, the current C-Python is really a combinationof C and Python implementation. There are about 2000 Python filesincluded in the Windows version of Python distribution. I''m not surehow much of the C-Python is implemented in C but I think the moremodules implemented in C, the better performance and lower memoryfootprint it will get.I wonder if it''s possible to have a Python that''s completely (or atleast for the most part) implemented in C, just like PHP - I thinkthis is where PHP gets its performance advantage. Or maybe I''m wrongbecause the core modules that matter are already in C and those Pythonfiles are really a think wrapper. Anyhow, if would be ideal if Pythonhas performance similar to Java, with both being interpreted languages.Jack 解决方案Prove it. ;-)Seriously, switching to more C code will cause development to bog downbecause Python is so much easier to write than C.Could you provide some evidence that Python is slower than Java or PHP?--Aahz (aa**@pythoncraft.com) <* http://www.pythoncraft.com/"Typing is cheap. Thinking is expensive." --Roy SmithWriting everything in C might be possible - but is a daunting task & notjustified by the results. And wherever the standard libraries make useof the flexibility of Python, it''s questionable if there really was anyperformance gain at all.But what REALLY is questionable is the alleged performance advantage -how do you back that up? According to the well-known (and surelylimited) computer language shootout http://shootout.alioth.debian.org/gp...t=all&lang=allPython is roughly 25% faster than PHP. Granted, this is just onebenchmark, with questionable real-life relevance. But where do you getthe impression from that PHP is faster than Python then?diezProve it. ;-)I guess this is subjective :) - that''s what I felt in my experiencewith web applications developed in Python and PHP. I wasn''t able tofind a direct comparison online.I understand. Python modules implemented in Python - this is howPython gets its really rich library.Could you provide some evidence that Python is slower than Java or PHP?I think most Java-Python benchmarks you can find online will indicatethat Java is a 3-10 times faster. A few here: http://mail.python.org/pipermail/pyt...ry/125789.html http://blog.snaplogic.org/?p=55Here''s an article that shows the new version of Ruby isfaster than Python in some aspects (they are catching up :) http://antoniocangiano.com/2007/11/2...s-python-away/ 这篇关于是一个“真实的” C-Python可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
05-27 17:43
查看更多