frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

A Love Letter to FreeBSD

https://www.tara.sh/posts/2025/2025-11-25_freebsd_letter/
136•rbanffy•2h ago•67 comments

Writing a good Claude.md

https://www.humanlayer.dev/blog/writing-a-good-claude-md
276•objcts•6h ago•86 comments

Algorithms for Optimization [pdf]

https://algorithmsbook.com/optimization/files/optimization.pdf
31•Anon84•1h ago•1 comments

Advent of Code 2025

https://adventofcode.com/2025/about
702•vismit2000•11h ago•238 comments

Bricklink suspends Marketplace operations in 35 countries (developing story)

https://jaysbrickblog.com/news/bricklink-suspends-marketplace-operations-in-35-countries/
33•makeitdouble•1h ago•6 comments

Windows drive letters are not limited to A-Z

https://www.ryanliptak.com/blog/windows-drive-letters-are-not-limited-to-a-z/
359•LorenDB•11h ago•172 comments

Migrating Dillo from GitHub

https://dillo-browser.org/news/migration-from-github/
261•todsacerdoti•10h ago•158 comments

LLVM-MOS – Clang LLVM fork targeting the 6502

https://llvm-mos.org/wiki/Welcome
104•jdmoreira•7h ago•34 comments

ESA Sentinel-1D delivers first high-resolution images

https://www.esa.int/Applications/Observing_the_Earth/Copernicus/Sentinel-1/Sentinel-1D_delivers_f...
74•giuliomagnifico•7h ago•20 comments

GitHub to Codeberg: my experience

https://eldred.fr/blog/forge-migration/
119•todsacerdoti•8h ago•48 comments

Program-of-Thought Prompting Outperforms Chain-of-Thought by 15% (2022)

https://arxiv.org/abs/2211.12588
63•mkagenius•6h ago•18 comments

Stop Hacklore – An Open Letter

https://www.hacklore.org/letter
90•zdw•4d ago•54 comments

ETH-Zurich: Digital Design and Computer Architecture; 227-0003-10L, Spring, 2025

https://safari.ethz.ch/ddca/spring2025/doku.php?id=start
111•__rito__•7h ago•17 comments

"Boobs check" – Technique to verify if sites behind CDN are hosted in Iran

https://twitter.com/hkashfi/status/1995109785679573167
179•defly•3h ago•59 comments

CachyOS: Fast and Customizable Linux Distribution

https://cachyos.org/
255•doener•14h ago•228 comments

People keep flocking to Linux, not just to escape Windows

https://www.zdnet.com/article/why-people-keep-flocking-to-linux-in-2025-and-its-not-just-to-escap...
117•breve•4h ago•79 comments

The Thinking Game Film – Google DeepMind documentary

https://thinkinggamefilm.com
139•ChrisArchitect•8h ago•104 comments

Show HN: Fixing Google Nano Banana Pixel Art with Rust

https://github.com/Hugo-Dz/spritefusion-pixel-snapper
118•HugoDz•4d ago•21 comments

Show HN: Real-time system that tracks how news spreads across 200k websites

https://yandori.io/news-flow/
217•antiochIst•4d ago•55 comments

There is No Quintic Formula [video]

https://www.youtube.com/watch?v=9HIy5dJE-zQ
52•DamnInteresting•6h ago•17 comments

RetailReady (YC W24) Is Hiring Associate Product Manager

https://www.ycombinator.com/companies/retailready/jobs/KPKDu3D-associate-product-manager
1•sarah74•7h ago

Langjam Gamejam: Build a programming language then make a game with it

https://langjamgamejam.com/
52•birdculture•8h ago•37 comments

NixOS 25.11 released

https://nixos.org/blog/announcements/2025/nixos-2511/
153•trulyrandom•6h ago•43 comments

A Second Look at Geolocation and Starlink

https://www.potaroo.net/ispcol/2025-11/starlinkgeo2.html
25•speckx•5d ago•6 comments

Paul Hegarty's updated CS193p SwiftUI course released by Stanford

https://cs193p.stanford.edu/
142•yehiaabdelm•5d ago•35 comments

Finding the grain of sand in a heap of Salt

https://blog.cloudflare.com/finding-the-grain-of-sand-in-a-heap-of-salt/
17•privacyops•3d ago•6 comments

Don't push AI down our throats

https://gpt3experiments.substack.com/p/dont-push-ai-down-our-throats
330•nutanc•6h ago•232 comments

Modern cars are spying on you. Here's what you can do about it

https://apnews.com/article/auto-car-privacy-3674ce59c9b30f2861d29178a31e6ab7
223•MilnerRoute•8h ago•227 comments

What's Hiding Inside Haribo's Power Bank and Headphones?

https://www.lumafield.com/first-article/posts/whats-hiding-inside-haribos-power-bank-and-headphones
212•rozenmd•3d ago•79 comments

Notes on Shadowing a Hospitalist

https://humaninvariant.substack.com/p/notes-on-shadowing-a-hospitalist
44•surprisetalk•7h ago•21 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