frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Migrating the Main Zig Repository from GitHub to Codeberg

https://ziglang.org/news/migrating-from-github-to-codeberg/
67•todsacerdoti•39m ago•12 comments

Bring Bathroom Doors Back to Hotels

https://bringbackdoors.com/
363•bariumbitmap•4h ago•268 comments

Voyager 1 is about to reach one light-day from Earth

https://scienceclock.com/voyager-1-is-about-to-reach-one-light-day-from-earth/
783•ashishgupta2209•12h ago•278 comments

Running Unsupported iOS on Deprecated Devices

https://nyansatan.github.io/run-unsupported-ios/
70•OuterVale•3h ago•18 comments

S&box is now an open source game engine

https://sbox.game/news/update-25-11-26
231•MaximilianEmel•6h ago•75 comments

Ilya Sutskever, Yann LeCun and the End of “Just Add GPUs”

https://www.abzglobal.net/web-development-blog/ilya-sutskever-yann-lecun-and-the-end-of-just-add-...
72•birdculture•2h ago•58 comments

Gemini CLI Tips and Tricks for Agentic Coding

https://github.com/addyosmani/gemini-cli-tips
198•ayoisaiah•8h ago•70 comments

A Fast 64-Bit Date Algorithm (30–40% faster by counting dates backwards)

https://www.benjoffe.com/fast-date-64
257•benjoffe•4d ago•56 comments

The EU made Apple adopt new Wi-Fi standards, and now Android can support AirDrop

https://arstechnica.com/gadgets/2025/11/the-eu-made-apple-adopt-new-wi-fi-standards-and-now-andro...
278•cyclecount•5h ago•129 comments

Fara-7B: An efficient agentic model for computer use

https://github.com/microsoft/fara
66•maxloh•7h ago•22 comments

The Tesla Model Y Just Scored the Worst Reliability Rating in a Decade

https://www.autoblog.com/news/the-bestselling-tesla-model-y-just-scored-the-worst-reliability-rat...
31•whynotmaybe•54m ago•25 comments

Comic Code Reviews

https://www.jona.ca/2025/11/comic-code-reviews.html
11•JonathanAquino•6d ago•4 comments

A woman on a mission to photograph every species of hummingbird

https://www.audubon.org/magazine/meet-woman-mission-photograph-every-species-of-hummingbird-world
95•zeech•4d ago•21 comments

How Does Microwaving Grapes Create Plumes of Plasma?

https://www.pbs.org/wgbh/nova/article/how-does-microwaving-grapes-create-plumes-plasma/
21•wredcoll•2d ago•5 comments

Alan.app – Add a Border to macOS Active Window

https://tyler.io/2025/11/alan/
85•donatj•7h ago•52 comments

A cell so minimal that it challenges definitions of life

https://www.quantamagazine.org/a-cell-so-minimal-that-it-challenges-definitions-of-life-20251124/
255•ibobev•16h ago•112 comments

Show HN: Safe-NPM – only install packages that are +90 days old

https://github.com/kevinslin/safe-npm
46•kevinslin•3d ago•31 comments

Statistical Process Control in Python

https://timothyfraser.com/sigma/statistical-process-control-in-python.html
196•lifeisstillgood•17h ago•62 comments

Don't Download Apps

https://blog.calebjay.com/posts/dont-download-apps/
261•speckx•6h ago•139 comments

Show HN: I turned algae into a bio-altimeter and put it on a weather balloon

https://radi8.dev/blog/stratospore/
102•radeeyate•4d ago•10 comments

AdBlock and Signal are for terrorists, according to French govt (2023) [video]

https://www.youtube.com/watch?v=1q1hjmwLqe4
27•pabs3•2h ago•3 comments

Compressed filesystems à la language models

https://grohan.co/2025/11/25/llmfuse/
35•grohan•11h ago•5 comments

Optery (YC W22) Hiring CISO, Release Manager, Tech Lead (Node), Full Stack Eng

https://www.optery.com/careers/
1•beyondd•9h ago

Show HN: Yolodex – real-time customer enrichment API

https://api.yolodex.ai
28•hazzadous•2d ago•10 comments

Show HN: KiDoom – Running DOOM on PCB Traces

https://www.mikeayles.com/#kidoom
323•mikeayles•1d ago•44 comments

DRAM prices are spiking, but I don't trust the industry's why

https://www.xda-developers.com/dram-prices-spiking-dont-trust-industry-reasons/
208•binarycrusader•9h ago•108 comments

Surprisingly, Emacs on Android is pretty good

https://kristofferbalintona.me/posts/202505291438/
238•harryday•3d ago•119 comments

A lightweight code editor with Vim mode, Git integration, and more

https://athas.dev
6•geordee•3d ago•5 comments

JOPA: Java compiler in C++, Jikes modernized to Java 6 with Claude

https://github.com/7mind/jopa
57•pshirshov•3d ago•45 comments

The Weird and Wonderful Chemistry of Audioactive Decay (1986) [pdf]

https://static01.nyt.com/packages/pdf/crossword/GENIUS_AT_PLAY_Eureka_Article.pdf
17•surprisetalk•5d ago•4 comments
Open in hackernews

Optimizing Heap Allocations in Go: A Case Study

https://www.dolthub.com/blog/2025-04-18-optimizing-heap-allocations/
54•ingve•7mo ago

Comments

returningfory2•7mo ago
> It's possible that this is a compiler bug. It's also possible that there's some fringe case where the reference actually can escape via that method call, and the compiler doesn't have enough context to rule it out.

Here's an example, I think: suppose the method spawns a new goroutine that contains a reference to `chunkStore`. This goroutine can outlive the `ReadBytes` function call, and thus Go has to heap allocate the thing being referenced.

In general, this kind of example makes me suspect that Go's escape analysis algorithm treats any method call as a black box and heap allocates anything being passed to it by reference.

athorax•7mo ago

  The notion of stack vs heap allocation isn't something that even exists in the language. Users are expected to not worry about it... until, of course, until you're optimizing performance and you need to worry about it.
This is one of the best and worst aspects with Go. Anyone can write pretty performant code without having to understand the underlying memory model. If you get to the point where you are trying to optimize at this level, the benefits of using a more approachable language start to fall apart and you spend more time chasing implementation details.
nu11ptr•7mo ago
In general, it is a win, since it lets you code faster and 80-90% the performance doesn't matter. Over time, you learn generally what leads to heap allocs and what doesn't. In rare hot spot, using -m will show you the allocations and you can optimize.
athorax•7mo ago
I would generally agree. It's good enough performance for most applications. For those that it isn't fast enough for (even with optimizations like these), it still allows for rapid prototyping to arrive at that conclusion.
Ygg2•7mo ago
I think same applies to any GC language. Ride is fun until GC starts either taking too much time, too much memory or taking too much of CPU.
Thaxll•7mo ago
At least you have the tools to understand where things get allocated.
38•7mo ago
instead of this:

    t.Buf = []byte{}
you can just do:

    t.Buf = nil
rsc•7mo ago
Those are semantically different (one is nil and one is not) but neither allocates.
virexene•7mo ago
I wonder if the reason the escape analysis fails could be that, for small enough types, the concrete value is directly inlined inside the interface value, instead of the latter being "a smart pointer" as the author said. So when the compiler needs to take a reference to the concrete value in `vs.chunkStore`, that ends up as an internal pointer inside the `vs` allocation, requiring it to be on the heap.

Either that or the escape analysis just isn't smart enough; taking a pointer to an internal component of an interface value seems like a bit of a stretch.

Snawoot•7mo ago
I had an attempt to improve performance of memory allocation with the use of arenas in Go and I chose freelist datastructure[1]

It almost doesn't use unsafe except one line to cast pointer types. I measured practical performance boost with "container/list" implementation hooked to my allocator. All in all it performs 2-5 times faster or up to 10 times faster if we can get rid[2] of any and allocations implied by the use of it.

All in all, heap allocations can be not that bad at all if you approach them from another angle.

[1]: https://github.com/Snawoot/freelist

[2]: https://github.com/Snawoot/list