frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Arthur Conan Doyle explored men’s mental health through Sherlock Holmes

https://scienceclock.com/arthur-conan-doyle-delved-into-mens-mental-health-through-his-sherlock-h...
115•PikelEmi•4h ago•115 comments

Don't be a scary old guy: My 40s survival strategy with charm

https://www.devas.life/dont-be-a-scary-old-guy-my-40s-survival-strategy-with-charm/
27•ashleynewman•42m ago•13 comments

TPUs vs. GPUs and why Google is positioned to win AI race in the long term

https://www.uncoveralpha.com/p/the-chip-made-for-the-ai-inference
25•vegasbrianc•2h ago•12 comments

Linux Kernel Explorer

https://reverser.dev/linux-kernel-explorer
340•tanelpoder•9h ago•51 comments

Penpot: The Open-Source Figma

https://github.com/penpot/penpot
502•selvan•13h ago•117 comments

Show HN: Runprompt – run .prompt files from the command line

https://github.com/chr15m/runprompt
11•chr15m•1h ago•0 comments

Ray Marching Soft Shadows in 2D (2020)

https://www.rykap.com/2020/09/23/distance-fields/
132•memalign•7h ago•21 comments

Interactive λ-Reduction

https://deltanets.org/
75•jy14898•2d ago•18 comments

The State of GPL Propagation to AI Models

https://shujisado.org/2025/11/27/gpl-propagates-to-ai-models-trained-on-gpl-code/
85•jonymo•2h ago•97 comments

Mixpanel Security Breach

https://mixpanel.com/blog/sms-security-incident/
110•jaredwiener•8h ago•75 comments

DIY NAS: 2026 Edition

https://blog.briancmoses.com/2025/11/diy-nas-2026-edition.html
280•sashk•12h ago•154 comments

Technical Deflation

https://benanderson.work/blog/technical-deflation/
35•0x79de•3d ago•24 comments

Music eases surgery and speeds recovery, study finds

https://www.bbc.com/news/articles/c231dv9zpz3o
131•1659447091•10h ago•48 comments

G0-G3 corners, visualised: learn what "Apple corners" are

https://www.printables.com/model/1490911-g0-g3-corners-visualised-learn-what-apple-corners
80•dgroshev•3d ago•42 comments

Willis Whitfield: Creator of clean room technology still in use today (2024)

https://www.sandia.gov/labnews/2024/04/04/willis-whitfield-a-simple-man-with-a-simple-solution-th...
121•rbanffy•2d ago•42 comments

Gemini CLI Tips and Tricks for Agentic Coding

https://github.com/addyosmani/gemini-cli-tips
333•ayoisaiah•21h ago•114 comments

Show HN: MkSlides – Markdown to slides with a similar workflow to MkDocs

https://github.com/MartenBE/mkslides
8•MartenBE•2h ago•0 comments

S&box is now an open source game engine

https://sbox.game/news/update-25-11-26
361•MaximilianEmel•19h ago•125 comments

The Concrete Pontoons of Bristol

https://thecretefleet.com/blog/f/the-concrete-pontoons-of-bristol
12•surprisetalk•6d ago•0 comments

Running Unsupported iOS on Deprecated Devices

https://nyansatan.github.io/run-unsupported-ios/
185•OuterVale•16h ago•77 comments

Coq: The World's Best Macro Assembler? (2013) [pdf]

https://nickbenton.name/coqasm.pdf
103•addaon•10h ago•35 comments

Closest Harmonic Number to an Integer

https://www.johndcook.com/blog/2025/11/19/closest-harmonic-number-to-an-integer/
23•ibobev•6d ago•3 comments

Last Issue of "ECMAScript News"

https://ecmascript.news/archive/es-next-news-2025-11-26.html
44•Klaster_1•9h ago•9 comments

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

https://www.benjoffe.com/fast-date-64
360•benjoffe•4d ago•84 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/
988•ashishgupta2209•1d ago•341 comments

Functional Data Structures and Algorithms: a Proof Assistant Approach

https://fdsa-book.net/
84•SchwKatze•13h ago•11 comments

Migrating the main Zig repository from GitHub to Codeberg

https://ziglang.org/news/migrating-from-github-to-codeberg/
758•todsacerdoti•13h ago•663 comments

A Nicotine Analogue I Had Known and Didn't Love: 6-Methylnicotine

https://psychotechnology.substack.com/p/a-nicotine-analogue-i-had-known-and
10•eatitraw•3d ago•3 comments

Essence and accident in language model-assisted coding

https://www.sicpers.info/2025/11/essence-and-accident-in-language-model-assisted-coding/
8•ingve•3d ago•0 comments

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

https://github.com/microsoft/fara
148•maxloh•20h ago•59 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