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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Impressed By Slow Code

68 点作者 angusgr大约 14 年前

3 条评论

antirez大约 14 年前
A much better C standard library would help a lot into thinking at C code from an higher level point of view. Especially if you have easy to use data structures in form of a lib, it is really easy to resist to use a list and O(N) lookups just to type less code where an hash table is a better feet.<p>Why the C standard library does not get improved with a few data types like linked lists, hash tables, dynamic strings, and so forth is something I can't understand (one common reason why poorly written C code ends slower than equivalent code wrote in a scripting language is because of strlen() and other stupid string operations into a loop ending into exponential time complexity).
评论 #2506310 未加载
评论 #2506212 未加载
merraksh大约 14 年前
<a href="http://news.ycombinator.com/item?id=2504672" rel="nofollow">http://news.ycombinator.com/item?id=2504672</a>
forgottenpaswrd大约 14 年前
"I've seen Python programs that ended up faster than C".<p>Yeah, there is nothing in c that makes it significant faster per se than python, remember python is pre-compiled.<p>C gives you control, it is "portable assembler" if you are used to assembler it is trivial to know exactly what the CPU does, if you can take advantage of it it will be faster, if you can't it wont.<p>With control you can make something run 100-1000 times faster because you know what the computer does, with a high level language you can not control it, period, it is abstracted.<p>That is the use of C or specific hardware(100-1000 less power usage).<p>Low level optimizations for a 10% speed up?. IMHO, Non sense.
评论 #2505910 未加载
评论 #2512412 未加载