Kevin Modzelewski

blog.kevmod.com · Personal blog · on HN since 2014

Kevin Modzelewski is a former Pyston and Dropbox engineer who writes about Python performance, JITs, and some math and economics.

What HN saysCommenters point to his posts on why Python is slow and on benchmarking with minimum values. They find them clear and persuasive.
17HN people shared it
11linked it in comments
20stories submitted
2.0Kstory points
3 years agolast shared
2014people per year2026

Most-shared posts

  1. 1
    Why is Python slow
    7 people · 282 points · first shared 2016 · 212 comments on HN
  2. 2
    Python performance: it’s not just the interpreter
    3 people · 318 points · first shared 2020 · 203 comments on HN
  3. 3
    Personal thoughts about Pyston's outcome
    3 people · 106 points · first shared 2017 · 67 comments on HN
  4. 4
    Is the Mill CPU real? (2014)
    2 people · 104 points · first shared 2015 · 60 comments on HN
  5. 5
  6. 6
    Amazon disallows pointing out paid reviews
    1 people · 1.1K points · first shared 2020 · 479 comments on HN
  7. 7
  8. 8
    Do the Real Numbers Exist?
    1 people · 26 points · first shared 2022 · 38 comments on HN
  9. 9
    “Do AIs think” == “Do submarines swim”
    1 people · 4 points · first shared 2022 · discussion on HN
  10. 10
    Blog migration and self-hosting retrospective
    1 people · 3 points · first shared 2022 · discussion on HN
  11. 11
    A new age of AI centaurs
    1 people · 3 points · first shared 2022 · discussion on HN
  12. 12
    Halting Problem == Russell’s Paradox?
    1 people · 3 points · first shared 2022 · 2 comments on HN
  13. 13
    Python, the GIL, and Pyston
    1 people · 2 points · first shared 2016 · discussion on HN
  14. 14
    Efficiency, and a simple formula for being a 10x-er
    1 people · 2 points · first shared 2022 · discussion on HN
  15. 15
    Tether’s Actual Peg
    1 people · 2 points · first shared 2022 · discussion on HN

What HN people wrote when they linked it

foota · 2016-07-07
There was someone a while ago in a group I was in making the claim that python was no inherently slower than other languages that were more static like Java. I might have to point them at this now. Great read! Reminds me of: http://blog.kevmod.com/2016/07/why-is-python-slow/ which was discussed a few days ago at https://news.ycombinator.com/item?id=12025309
kmod · 2023-05-25
IANAMathematician, but it's "true" in the sense that we primarily use a set of axioms (ZF/ZFC) which produce this result. But in a sense one of the axioms is that these things exist (powerset axiom), so this result is a bit less illuminating than one might hope. My understanding is that we can reason about these sorts of non-constructible sequences but we can't really know if they "really exist" because it's not clear what that even means if their existence has no implications for physical reality (which is possible but not known). So now we're into the territory of whether there is such a thing as abstract truth independent of reality. I wrote a blog post in the past about my reading on this topic, and I can't claim that's it's accurate but at least I tried to talk about this subject: https://blog.kevmod.com/2022/04/09/do-the-real-numbers-exist/
pansa2 · 2021-02-08
I’m afraid I don’t know the details. However, this post seems relevant - someone who worked on the JIT at Dropbox describes how expensive function calls in CPython can be: https://blog.kevmod.com/2020/05/python-performance-its-not-just-the-in…
rrss · 2019-08-04
> using minimum values is almost never a good idea Care to explain why? I find the argument in http://blog.kevmod.com/2016/06/benchmarking-minimum-vs-average/ for using the minimum to be pretty compelling. Also, FWIW, Julia's automated performance tracking determines likely regressions based on the minimum. Their reasoning is explained in http://math.mit.edu/~edelman/publications/robust_benchmarking.pdf.
lorenzfx · 2017-10-25
I believe this article [0] (previous discussion [1]) from one of pyston's authors gives a much better overview of why python is slow. [0] http://blog.kevmod.com/2016/07/why-is-python-slow/ [1] https://news.ycombinator.com/item?id=12025309
mhneu · 2017-02-01
You are right, the difficulties are in Python's design. See the Pyston blog "Why is Python slow". http://blog.kevmod.com/2016/07/why-is-python-slow/ That said, the Pyston guys knew what the problems were (dynamism in C runtime) and were making progress. This was the future of fast Python - JIT experts optimizing the runtime and feeding code and ideas back to CPython. I think we will look back at this Pyston announcement as the turning point where people gave up on Python speed.
codezero · 2017-01-12
Someone asked something similar a while ago: http://blog.kevmod.com/2014/07/the-mill-cpu/ Ivan responded to the post but didn't address the questions about his bio at all, but perhaps he doesn't feel the need to. For the curious, his name apparently was Mark Rain for some time in the 70s/80s [1] – there are a number of publications under that name. [1] http://newsgroups.derkeiler.com/Archive/Comp/comp.arch/2012-08/msg0044…
indolering · 2016-07-07
According to the Pyston developers, yes[1]. [1] http://blog.kevmod.com/2016/07/why-is-python-slow/
arc776 · 2020-10-21
> Can you give specific examples and prove that they cannot be overcome? It's hard to prove a theoretical negative, but perhaps by comparison with the run time performance of static AOT (SAOT) compiled languages I can show what I mean. Dynamic typing: - Python requires dynamic type checking before any program work is done. SAOT doesn't need to do any run time work. - Adding two numbers in Python requires handling run time overloads and a host of other complexities. SAOT is a single machine code instruction that requires no extra work. Boxing values: - Python value boxing requires jumping about in heap memory. SAOT language can not only remove this cost but reduce it to raw registers loaded from the stack and prefetched in chunks. This massively improves cache performance by orders of magnitude. Determinism: - In Python program operation can only be determined by running the code. In SAOT, since all the information is known at compile time programs can be further folded down, loops unrolled, and/or SIMD applied. Run time overheads - Python requires an interpretive run time. SAOT does not. In summary: Python necessarily requires extra work at run time due to dynamic behaviour. SAOT languages can eliminate this extra work. I do understand though that with JIT a lot of these costs can be reduced massively if not eliminated once the JIT has run through the code once. For example here they go through the painful process of optimising Python code to find what is…
wallnuss · 2017-11-22
The blog is fun introduction into JIT compiler, but the big thing that is missing and that makes Python a hard problem for JIT is supporting Objects. From http://blog.kevmod.com/2017/02/personal-thoughts-about-pystons-outcome… I'll try to just talk about what makes Python hard to run quickly (especially as compared to less-dynamic languages like JS or Lua). The thing I wish people understood about Python performance is that the difficulties come from Python's extremely rich object model, not from anything about its dynamic scopes or dynamic types. The problem is that every operation in Python will typically have multiple points at which the user can override the behavior, and these features are used, often very extensively. Some examples are inspecting the locals of a frame after the frame has exited, mutating functions in-place, or even something as banal as overriding isinstance. These are all things that we had to support, and are used enough that we have to support efficiently, and don't have analogs in less-dynamic languages like JS or Lua.
tony · 2020-02-09
I'm not sure if it's an exact fit, but dropbox used to have pyston: https://github.com/dropbox/pyston The blog posts by Kevin Modzelewski went into the internals: https://blog.pyston.org/ Also by the same person, a good article on Python's performance: http://blog.kevmod.com/2016/07/why-is-python-slow/ As a side comment: On the subject of type inference, I really come to like python's type hints. I don't use mypy itself yet, but already had a habit of adding types in docstrings, and like it when I can add a clue that a signature/return is dealing with a something that's not a basic type. There are some nice little things out there for advanced typing, being added now and then: - TypedDict and Literal: https://github.com/python/typing/blob/master/typing_extensions/README.… (TypedDict was accepted in PEP 589[1]) - NamedTuple had variable annotation added in Python 3.6: https://www.python.org/dev/peps/pep-0526/ I wonder if typings are added to a codebase, we could give LLVM one more shot. It'd be pretty crazy to build able to build a large graphql server and build it into a statically linked binary like golang. [1] https://www.python.org/dev/peps/pep-0589/

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close