TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Optimizing Python with Cython

5 点作者 erjiang将近 10 年前

3 条评论

syllogism将近 10 年前
If you can live with changing the signature from two tuples to just taking the four floats, you&#x27;ll see a big further improvement --- these are the only lines showing up yellow when running the code through cython -a: <a href="https:&#x2F;&#x2F;rawgit.com&#x2F;syllog1sm&#x2F;a13542690c59d5e60ebf&#x2F;raw&#x2F;4994187cd560aab45dabe772a376171f409bd109&#x2F;gistfile1.html" rel="nofollow">https:&#x2F;&#x2F;rawgit.com&#x2F;syllog1sm&#x2F;a13542690c59d5e60ebf&#x2F;raw&#x2F;499418...</a>
AdmiralAsshat将近 10 年前
Looking at this step:<p><i>-from math import sin, cos, acos</i><p><i>+from libc.math cimport sin, cos, acos</i><p>What happens if the C math functions and the Python math functions don&#x27;t take the same arguments&#x2F;kinds of arguments?
kirbyfan64sos将近 10 年前
On my system, PyPy is 4x faster than the fastest Cython version given.