frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

How Meta Made Linux a Planet-Scale Load Balancer

https://softwarefrontier.substack.com/p/how-meta-turned-the-linux-kernel
1•CortexFlow•28s ago•0 comments

A Turing Test for AI Coding

https://t-cadet.github.io/programming-wisdom/#2026-02-06-a-turing-test-for-ai-coding
1•phi-system•39s ago•0 comments

How to Identify and Eliminate Unused AWS Resources

https://medium.com/@vkelk/how-to-identify-and-eliminate-unused-aws-resources-b0e2040b4de8
1•vkelk•1m ago•0 comments

A2CDVI – HDMI output from from the Apple IIc's digital video output connector

https://github.com/MrTechGadget/A2C_DVI_SMD
1•mmoogle•2m ago•0 comments

CLI for Common Playwright Actions

https://github.com/microsoft/playwright-cli
1•saikatsg•3m ago•0 comments

Would you use an e-commerce platform that shares transaction fees with users?

https://moondala.one/
1•HamoodBahzar•4m ago•1 comments

Show HN: SafeClaw – a way to manage multiple Claude Code instances in containers

https://github.com/ykdojo/safeclaw
2•ykdojo•7m ago•0 comments

The Future of the Global Open-Source AI Ecosystem: From DeepSeek to AI+

https://huggingface.co/blog/huggingface/one-year-since-the-deepseek-moment-blog-3
3•gmays•8m ago•0 comments

The Evolution of the Interface

https://www.asktog.com/columns/038MacUITrends.html
2•dhruv3006•9m ago•0 comments

Azure: Virtual network routing appliance overview

https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-routing-appliance-overview
2•mariuz•10m ago•0 comments

Seedance2 – multi-shot AI video generation

https://www.genstory.app/story-template/seedance2-ai-story-generator
2•RyanMu•13m ago•1 comments

Πfs – The Data-Free Filesystem

https://github.com/philipl/pifs
2•ravenical•16m ago•0 comments

Go-busybox: A sandboxable port of busybox for AI agents

https://github.com/rcarmo/go-busybox
3•rcarmo•17m ago•0 comments

Quantization-Aware Distillation for NVFP4 Inference Accuracy Recovery [pdf]

https://research.nvidia.com/labs/nemotron/files/NVFP4-QAD-Report.pdf
2•gmays•18m ago•0 comments

xAI Merger Poses Bigger Threat to OpenAI, Anthropic

https://www.bloomberg.com/news/newsletters/2026-02-03/musk-s-xai-merger-poses-bigger-threat-to-op...
2•andsoitis•18m ago•0 comments

Atlas Airborne (Boston Dynamics and RAI Institute) [video]

https://www.youtube.com/watch?v=UNorxwlZlFk
2•lysace•19m ago•0 comments

Zen Tools

http://postmake.io/zen-list
2•Malfunction92•22m ago•0 comments

Is the Detachment in the Room? – Agents, Cruelty, and Empathy

https://hailey.at/posts/3mear2n7v3k2r
2•carnevalem•22m ago•1 comments

The purpose of Continuous Integration is to fail

https://blog.nix-ci.com/post/2026-02-05_the-purpose-of-ci-is-to-fail
1•zdw•24m ago•0 comments

Apfelstrudel: Live coding music environment with AI agent chat

https://github.com/rcarmo/apfelstrudel
2•rcarmo•25m ago•0 comments

What Is Stoicism?

https://stoacentral.com/guides/what-is-stoicism
3•0xmattf•26m ago•0 comments

What happens when a neighborhood is built around a farm

https://grist.org/cities/what-happens-when-a-neighborhood-is-built-around-a-farm/
1•Brajeshwar•26m ago•0 comments

Every major galaxy is speeding away from the Milky Way, except one

https://www.livescience.com/space/cosmology/every-major-galaxy-is-speeding-away-from-the-milky-wa...
3•Brajeshwar•26m ago•0 comments

Extreme Inequality Presages the Revolt Against It

https://www.noemamag.com/extreme-inequality-presages-the-revolt-against-it/
2•Brajeshwar•26m ago•0 comments

There's no such thing as "tech" (Ten years later)

1•dtjb•27m ago•0 comments

What Really Killed Flash Player: A Six-Year Campaign of Deliberate Platform Work

https://medium.com/@aglaforge/what-really-killed-flash-player-a-six-year-campaign-of-deliberate-p...
1•jbegley•27m ago•0 comments

Ask HN: Anyone orchestrating multiple AI coding agents in parallel?

1•buildingwdavid•29m ago•0 comments

Show HN: Knowledge-Bank

https://github.com/gabrywu-public/knowledge-bank
1•gabrywu•34m ago•0 comments

Show HN: The Codeverse Hub Linux

https://github.com/TheCodeVerseHub/CodeVerseLinuxDistro
3•sinisterMage•35m ago•2 comments

Take a trip to Japan's Dododo Land, the most irritating place on Earth

https://soranews24.com/2026/02/07/take-a-trip-to-japans-dododo-land-the-most-irritating-place-on-...
2•zdw•35m ago•0 comments
Open in hackernews

Patterns for Faster Python Code

https://blog.jetbrains.com/pycharm/2025/11/10-smart-performance-hacks-for-faster-python-code/
8•birdculture•2mo ago

Comments

zahlman•2mo ago
> This is a guest post from Dido Grigorov, a deep learning engineer and Python programmer with 17 years of experience in the field.

This is definitely not the sort of thing that takes 17 years of experience to write up.

There isn't a big distinction drawn here between big-O savings and micro-optimizations; the former are mostly CS fundamentals (especially the set lookup thing in point 1) and you're left to infer (or know) what's what in that regard. There's also zero distinction between things that have any specific connection to Python (or even more specifically to the CPython implementation) and things that every programmer should know (and often just doesn't think about; cf. https://danluu.com/algorithms-interviews/).

The timing is naive, and supposed benefits aren't even all reproducible. In particular, the pre-allocation strategy (point 5) only makes sense if you can reuse pre-allocated storage (which for a lot of algorithms in Python is going to involve tracking the number of used elements manually since it won't be fixed). On my machine with recent Python I consistently get the opposite result for the demos; the dynamic allocation is slightly faster. (But of course, this is a silly toy example, where you get even better performance by doing `list(range(1000000))` — which is how it's done in point 4!) Similarly, the performance difference with `itertools.product` is less dramatic with a proper timing technique, and becomes much less dramatic using a list comprehension to assemble the list rather than repeated appending.

The analysis is largely incomplete. The `__slots__` example is presented as a memory optimization (which it is) but then benchmarked for speed. And it's also not compared to analogous use of `namedtuple`, `Dataclass` etc.

The last point is almost misleading; one expects a discussion of function call overhead and the trade-off of inlining, but actually it's about looking for repeated calculations of something that could be cached. Which... applies a lot more broadly than presented.

And of course, everything is written in a super-padded, self-important LLMish style (sentences like "This technique is particularly valuable in numerical computations, simulations, and large-scale data processing, where even small optimizations can add up." are practically information-free). Which, of course, takes pains to shill for the IDE made by the publishers. (Did you know that our IDE helps you auto-complete references to standard library module contents? Never mind that if you care about optimization on the level of choosing `math.sqrt` over the `*` operator for performance reasons, and for some reason you can't choose a different language, you're probably also going to care about the name lookup).

Oh, and the examples in point 6 aren't even equivalent! They compute different results and the slower exception-handling one also invokes floating-point math. These issues turn out not to affect the execution time much, but it still looks quite sloppy. (Not to mention, it's unusual that real-world code would end up raising exceptions this frequently in normal use, and when it does it won't be that obvious.)