frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Pebble Watch software is now 100% open source

https://ericmigi.com/blog/pebble-watch-software-is-now-100percent-open-source
819•Larrikin•11h ago•125 comments

Unpowered SSDs slowly lose data

https://www.xda-developers.com/your-unpowered-ssd-is-slowly-losing-your-data/
325•amichail•10h ago•132 comments

Claude Advanced Tool Use

https://www.anthropic.com/engineering/advanced-tool-use
433•lebovic•10h ago•163 comments

A million ways to die from a data race in Go

https://gaultier.github.io/blog/a_million_ways_to_data_race_in_go.html
18•ingve•2d ago•2 comments

Cool-retro-term: terminal emulator which mimics look and feel of CRTs

https://github.com/Swordfish90/cool-retro-term
201•michalpleban•12h ago•77 comments

Show HN: I built an interactive HN Simulator

https://news.ysimulator.run/news
235•johnsillings•12h ago•121 comments

Three Years from GPT-3 to Gemini 3

https://www.oneusefulthing.org/p/three-years-from-gpt-3-to-gemini
239•JumpCrisscross•2d ago•154 comments

Implications of AI to schools

https://twitter.com/karpathy/status/1993010584175141038
160•bilsbie•12h ago•154 comments

Show HN: OCR Arena – A playground for OCR models

https://www.ocrarena.ai/battle
112•kbyatnal•3d ago•39 comments

How did the Windows 95 user interface code get to the Windows NT code base?

https://devblogs.microsoft.com/oldnewthing/20251028-00/?p=111733
34•ayi•3d ago•10 comments

Build a Compiler in Five Projects

https://kmicinski.com/functional-programming/2025/11/23/build-a-language/
72•azhenley•22h ago•10 comments

Claude Opus 4.5

https://www.anthropic.com/news/claude-opus-4-5
868•adocomplete•11h ago•395 comments

What OpenAI did when ChatGPT users lost touch with reality

https://www.nytimes.com/2025/11/23/technology/openai-chatgpt-users-risks.html
157•nonprofiteer•1d ago•186 comments

The Bitter Lesson of LLM Extensions

https://www.sawyerhood.com/blog/llm-extension
101•sawyerjhood•11h ago•51 comments

Moving from OpenBSD to FreeBSD for firewalls

https://utcc.utoronto.ca/~cks/space/blog/sysadmin/OpenBSDToFreeBSDMove
165•zdw•5d ago•91 comments

Random lasers from peanut kernel doped with birch leaf–derived carbon dots

https://www.degruyterbrill.com/document/doi/10.1515/nanoph-2025-0312/html
36•PaulHoule•5d ago•12 comments

Chrome Jpegxl Issue Reopened

https://issues.chromium.org/issues/40168998
225•markdog12•17h ago•85 comments

Google's new 'Aluminium OS' project brings Android to PC

https://www.androidauthority.com/aluminium-os-android-for-pcs-3619092/
90•jmsflknr•11h ago•101 comments

Shai-Hulud Returns: Over 300 NPM Packages Infected

https://helixguard.ai/blog/malicious-sha1hulud-2025-11-24
899•mrdosija•19h ago•704 comments

Migrating to Bazel symbolic macros

https://www.tweag.io/blog/2025-11-20-migrating-bazel-symbolic-macros/
6•todsacerdoti•2d ago•0 comments

Using Antigravity for Statistical Physics in JavaScript

https://christopherkrapu.com/blog/2025/antigravity-stat-mech/
11•ckrapu•3d ago•8 comments

PS5 now costs less than 64GB of DDR5 memory. RAM jumps to $600 due to shortage

https://www.tomshardware.com/pc-components/ddr5/64gb-of-ddr5-memory-now-costs-more-than-an-entire...
334•speckx•10h ago•210 comments

Show HN: Datamorph – A clean JSON ⇄ CSV converter with auto-detect

https://datamorphio.vercel.app
3•sumit_entr42•3d ago•0 comments

Fifty Shades of OOP

https://lesleylai.info/en/fifty_shades_of_oop/
74•todsacerdoti•20h ago•27 comments

Building the largest known Kubernetes cluster

https://cloud.google.com/blog/products/containers-kubernetes/how-we-built-a-130000-node-gke-cluster/
121•TangerineDream•3d ago•69 comments

Corvus Robotics (YC S18): Hiring Head of Mfg/Ops, Next Door to YC Mountain View

1•robot_jackie•12h ago

The history of Indian science fiction

https://altermag.com/articles/the-secret-history-of-indian-science-fiction
138•adityaathalye•2d ago•13 comments

How sea turtles learn locations using Earth’s magnetic field: research

https://uncnews.unc.edu/2025/02/13/sea-turtles-secret-gps-researchers-uncover-how-sea-turtles-lea...
24•hhs•3d ago•4 comments

Inside Rust's std and parking_lot mutexes – who wins?

https://blog.cuongle.dev/p/inside-rusts-std-and-parking-lot-mutexes-who-win
148•signa11•5d ago•69 comments

Bytes before FLOPS: your algorithm is (mostly) fine, your data isn't

https://www.bitsdraumar.is/bytes-before-flops/
47•bofersen•1d ago•11 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