How to Speed up a Python Program 114,000 times.
InfoQ3 HN recommenders · recommended in 3 months, 2015–2022
talk · intermediate · evergreen · 2015–2022 on HN
David Schachter describes how he made a data-collection Python program run 114,000 times faster, drawing on decades of experience. The talk covers pipelining, cache effects and other optimization lessons.
A favorite tech talk on HN for showing that hardware knowledge and generalist skills beat simply adding machines.
Up next
1 mo on HNLocksmith ripoffs: Hidden camera investigation (Marketplace)
CBC News
1 HN recommend · 2021–2024
5 mo on HN"Games as a service" is fraud.
Accursed Farms
5 HN recommender · 2019–2024
3 mo on HNRant: Entity systems and the Rust borrow checker ... or something.
Jonathan Blow
3 HN recommender · 2018–2025
2 mo on HNDesign Microservice Architectures the Right Way
InfoQ
2 HN recommender · 2019–2021
9 mo on HNMike Monteiro: F*ck You, Pay Me
CreativeMornings HQ
12 HN recommender · 2015–2026
10 mo on HNCrockford on JavaScript - Volume 1: The Early Years
YUI Library
10 HN recommender · 2013–2022
2 mo on HNHomemade Transistor Demonstration
Jeri Ellsworth
2 HN recommender · 2013–2021
3 mo on HNWhere Do Trees Get Their Mass?
Veritasium
3 HN recommender · 2015–2021
16 mo on HNHow Python was Shaped by leaky Internals, Armin Ronacher, Flask framework
Видео с мероприятий {speach!
15 HN recommender · 2017–2025
11 mo on HNCppCon 2015: Andrei Alexandrescu “std::allocator...”
CppCon
7 HN recommender · 2017–2025
12 mo on HNPreventing the Collapse of Civilization / Jonathan Blow (Thekla, Inc)
DevGAMM
14 HN recommender · 2020–2025
10 mo on HN"Performance Matters" by Emery Berger
Strange Loop Conference
12 HN recommender · 2019–2025
5 comments from Hacker News
"How to Speed up a Python Program 114,000 times." - ▶ this video Humour, serious technical insight and a good reminder of why being a generalist is an advantage.
I thought this was going to be "How to Speed up a Python Program 114,000 times"[0]. It's an hour-long talk, but quite enjoyable. In the example in the talk, it was less about knowing cs algorithms and more about knowing the details of how modern computer architecture works, but the lesson is the same: sometimes the background knowledge of a cs degree is useful. He also has the same point about optimizing our code rather than just adding more and more machines. [0] ▶ this video
This will technically only work on pipelined architectures of which all major CPU architectures are one. You will be able to see a significant boost to performance given the following are all true: * You have no inter dependancy of information across the lines * All your data is in the cache * You don't have instructions generated between the two lines that will require some sort of operand forwarding Basically, if you already have the stuff in the cache, the calculation is invarent to the last calculation, and you have a processor capable of it you'll see a large speed improvement. There is a great talk about this [0] (for the exact moment go to [1]). If you're interested further I'd very much recommend finding some sort of GOOD computer architecture class. Luckily now we have a fantastic resource to locate these such courses [2]. This seems like dark magic and many programmers refuse to come to terms with it's existence. Check out `dreta`'s comment to see an example. Now I do agree with dreta, this is VERY much architecture dependant but most architectures would benifit from this sort of optimization. Pretty much all modern Intel and AMD CPU's caches are large enough, they support a big enough cache, and they also all have pipelines under the hood. Intel started this in the pentium series with a 5-stage-pipeline (which I find very funny due to the GHz wars that came from that time period desipte the pipeline being probably the pargest performance boon in most cases that you
> I remember I recently saw a lecture by an industry professional who took a Python algorithm and improved it 100 000x, in parts. That is, in stages he explained how to utilize the hardware on that particular machine, to improve the algorithm so much that it was hard to believe. Anyone have a link? I suspect it's this one: ▶ this video
An example of "scaling in" is this talk, "How to speed up a Python program 114,000 times": ▶ this video