按年被提到
20192019 · 3 次2026
编程语言与编译器›类型系统与函数式语言·arXiv:1911.12338 · cs.OH

Inflationary Constant Factors and Why Python is Faster Than C++

Mehrdad Niknami · 2019
开始阅读 ↗PDFalphaXiv 讨论
被提及 · 2 人首次 2019-12-03 · 最近 2021-03-04
2不同的人
2活跃月份
4讨论串
1被引(OpenAlex)
arXiv 摘要(候选层不写导读)

Constant-factor differences are frequently ignored when analyzing the complexity of algorithms and implementations, as they appear to be insignificant in practice. In this paper, we demonstrate that this assumption can in fact have far more profound implications on time complexity than is obvious at first glance, and that a poor consideration of trade-offs can result in polynomially slower algorithms whose roots can be deeply and fundamentally ingrained into a programming language itself. While the general observation may not be novel from a theoretical standpoint, it is rarely (if ever) presented in traditional computer science curricula or other settings, and appears to be far from common knowledge in practical software engineering. We thus hope bring awareness to this issue and urge careful consideration of significant trade-offs that can result from trivial decisions made while programming.

候选层:至少 2 个不同的人、在 2 个不同月份提到过,还没到主书架的 3 人 3 个月。没有做立场标注,所以只写“被提及”。

HN 书评

没有评论直接链到它;下面是它被提交的讨论串里回复最多的评论(不计入统计)
讨论串评论IgorPartola · 2021-03

“I’ve been thinking about this lately. Can you actually be faster than C? Like, in the sense that you can transpile any bit of Python or Lisp or Haskell or Rust or JS into C but the opposite isn’t necessarily true because not all those language support all the features exposed in C (such as goto, no bounds checking, pointer arithmetic, etc.), any algorithm…”

Accidentally quadratic: When Python is faster than C++原评论 ↗
讨论串评论mehrdadn · 2021-03

“If you're wondering whether this is a theoretical or practical problem: I actually observed some of this effect in practice first, and only after thinking about it for a while did the larger issue (and the complexity implications) dawn on me. I had something like a set<string> or a set<set<string>> (or map... I can't remember which) somewhere in my progr…”

Accidentally quadratic: When Python is faster than C++原评论 ↗
讨论串评论a-dub · 2021-03

“cpython is faster than c++ under the following circumstances: 1) when you're using native libraries via python that were written by better c/c++ programmers than you are and you're spending most of your time within them 2) when you're using native libraries in python that are better implementations than the c/c++ libraries you're comparing against 3) w…”

Accidentally quadratic: When Python is faster than C++原评论 ↗
被提交为 story · 4 次