frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

X (Twitter) is back with a new X API Pay-Per-Use model

https://developer.x.com/
2•eeko_systems•4m ago•0 comments

Zlob.h 100% POSIX and glibc compatible globbing lib that is faste and better

https://github.com/dmtrKovalenko/zlob
1•neogoose•7m ago•1 comments

Show HN: Deterministic signal triangulation using a fixed .72% variance constant

https://github.com/mabrucker85-prog/Project_Lance_Core
1•mav5431•8m ago•1 comments

Scientists Discover Levitating Time Crystals You Can Hold, Defy Newton’s 3rd Law

https://phys.org/news/2026-02-scientists-levitating-crystals.html
1•sizzle•8m ago•0 comments

When Michelangelo Met Titian

https://www.wsj.com/arts-culture/books/michelangelo-titian-review-the-renaissances-odd-couple-e34...
1•keiferski•9m ago•0 comments

Solving NYT Pips with DLX

https://github.com/DonoG/NYTPips4Processing
1•impossiblecode•9m ago•1 comments

Baldur's Gate to be turned into TV series – without the game's developers

https://www.bbc.com/news/articles/c24g457y534o
2•vunderba•10m ago•0 comments

Interview with 'Just use a VPS' bro (OpenClaw version) [video]

https://www.youtube.com/watch?v=40SnEd1RWUU
1•dangtony98•15m ago•0 comments

EchoJEPA: Latent Predictive Foundation Model for Echocardiography

https://github.com/bowang-lab/EchoJEPA
1•euvin•23m ago•0 comments

Disablling Go Telemetry

https://go.dev/doc/telemetry
1•1vuio0pswjnm7•25m ago•0 comments

Effective Nihilism

https://www.effectivenihilism.org/
1•abetusk•28m ago•1 comments

The UK government didn't want you to see this report on ecosystem collapse

https://www.theguardian.com/commentisfree/2026/jan/27/uk-government-report-ecosystem-collapse-foi...
3•pabs3•30m ago•0 comments

No 10 blocks report on impact of rainforest collapse on food prices

https://www.thetimes.com/uk/environment/article/no-10-blocks-report-on-impact-of-rainforest-colla...
2•pabs3•30m ago•0 comments

Seedance 2.0 Is Coming

https://seedance-2.app/
1•Jenny249•32m ago•0 comments

Show HN: Fitspire – a simple 5-minute workout app for busy people (iOS)

https://apps.apple.com/us/app/fitspire-5-minute-workout/id6758784938
1•devavinoth12•32m ago•0 comments

Dexterous robotic hands: 2009 – 2014 – 2025

https://old.reddit.com/r/robotics/comments/1qp7z15/dexterous_robotic_hands_2009_2014_2025/
1•gmays•36m ago•0 comments

Interop 2025: A Year of Convergence

https://webkit.org/blog/17808/interop-2025-review/
1•ksec•46m ago•1 comments

JobArena – Human Intuition vs. Artificial Intelligence

https://www.jobarena.ai/
1•84634E1A607A•49m ago•0 comments

Concept Artists Say Generative AI References Only Make Their Jobs Harder

https://thisweekinvideogames.com/feature/concept-artists-in-games-say-generative-ai-references-on...
1•KittenInABox•53m ago•0 comments

Show HN: PaySentry – Open-source control plane for AI agent payments

https://github.com/mkmkkkkk/paysentry
2•mkyang•55m ago•0 comments

Show HN: Moli P2P – An ephemeral, serverless image gallery (Rust and WebRTC)

https://moli-green.is/
2•ShinyaKoyano•1h ago•1 comments

The Crumbling Workflow Moat: Aggregation Theory's Final Chapter

https://twitter.com/nicbstme/status/2019149771706102022
1•SubiculumCode•1h ago•0 comments

Pax Historia – User and AI powered gaming platform

https://www.ycombinator.com/launches/PMu-pax-historia-user-ai-powered-gaming-platform
2•Osiris30•1h ago•0 comments

Show HN: I built a RAG engine to search Singaporean laws

https://github.com/adityaprasad-sudo/Explore-Singapore
3•ambitious_potat•1h ago•4 comments

Scams, Fraud, and Fake Apps: How to Protect Your Money in a Mobile-First Economy

https://blog.afrowallet.co/en_GB/tiers-app/scams-fraud-and-fake-apps-in-africa
1•jonatask•1h ago•0 comments

Porting Doom to My WebAssembly VM

https://irreducible.io/blog/porting-doom-to-wasm/
2•irreducible•1h ago•0 comments

Cognitive Style and Visual Attention in Multimodal Museum Exhibitions

https://www.mdpi.com/2075-5309/15/16/2968
1•rbanffy•1h ago•0 comments

Full-Blown Cross-Assembler in a Bash Script

https://hackaday.com/2026/02/06/full-blown-cross-assembler-in-a-bash-script/
1•grajmanu•1h ago•0 comments

Logic Puzzles: Why the Liar Is the Helpful One

https://blog.szczepan.org/blog/knights-and-knaves/
1•wasabi991011•1h ago•0 comments

Optical Combs Help Radio Telescopes Work Together

https://hackaday.com/2026/02/03/optical-combs-help-radio-telescopes-work-together/
2•toomuchtodo•1h ago•1 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.)