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

TL;DR
This paper highlights how ignoring constant factors in algorithm analysis can lead to significant practical differences, such as Python outperforming C++ due to fundamental trade-offs rooted in language design.
Contribution
It reveals the profound impact of constant-factor considerations on time complexity and programming language performance, emphasizing overlooked trade-offs in software engineering.
Findings
Constant factors can cause polynomially slower algorithms in practice.
Language design choices deeply influence performance trade-offs.
Awareness of these factors can improve algorithm and implementation efficiency.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsComputability, Logic, AI Algorithms · Parallel Computing and Optimization Techniques · Computational Physics and Python Applications
