frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Friendship Begins at Home

https://3quarksdaily.com/3quarksdaily/2025/10/friendship-begins-at-home.html
41•herbertl•3h ago•4 comments

EQ: A video about all forms of equalizers

https://www.youtube.com/watch?v=CLAt95PrwL4
55•robinhouston•18h ago•14 comments

Chen-Ning Yang, Nobel laureate, dies at 103

https://www.chinadaily.com.cn/a/202510/18/WS68f3170ea310f735438b5bf2.html
184•nhatcher•23h ago•45 comments

Root System Drawings

https://images.wur.nl/digital/collection/coll13/search
309•bookofjoe•15h ago•59 comments

How sober should a writer be?

https://yalereview.org/article/crosley-how-sober-should-a-writer-be
17•samclemens•1w ago•6 comments

How does Turbo listen for Turbo Streams

https://ducktypelabs.com/how-does-turbo-listen-for-turbo-streams/
19•sidk_•5d ago•0 comments

How to sequence your DNA for <$2k

https://maxlangenkamp.substack.com/p/how-to-sequence-your-dna-for-2k
126•yichab0d•8h ago•58 comments

The reason GCC is not a library (2000)

https://gcc.gnu.org/legacy-ml/gcc/2000-01/msg00572.html
98•todsacerdoti•6d ago•37 comments

Titan submersible’s $62 SanDisk memory card found undamaged at wreckage site

https://www.tomshardware.com/pc-components/microsd-cards/tragic-oceangate-titan-submersibles-usd6...
248•WithinReason•1d ago•129 comments

The Accountability Problem

https://www.jamesshore.com/v2/blog/2025/the-accountability-problem
15•FrancoisBosun•2h ago•1 comments

Flowistry: An IDE plugin for Rust that focuses on relevant code

https://github.com/willcrichton/flowistry
180•Bogdanp•14h ago•25 comments

Is Postgres read heavy or write heavy?

https://www.crunchydata.com/blog/is-postgres-read-heavy-or-write-heavy-and-why-should-you-care
129•soheilpro•1d ago•35 comments

./watch

https://dotslashwatch.com/
330•shrx•19h ago•90 comments

GoGoGrandparent (YC S16) Is Hiring Back End and Full-Stack Engineers

1•davidchl•3h ago

Why the open social web matters now

https://werd.io/why-the-open-social-web-matters-now/
120•benwerd•4d ago•60 comments

Secret diplomatic message deciphered after 350 years

https://www.nationalarchives.gov.uk/explore-the-collection/the-collection-blog/secret-diplomatic-...
123•robin_reala•2d ago•16 comments

The Rise and Fall of the Powdered Wig (2020)

https://www.battlefields.org/learn/head-tilting-history/rise-and-fall-powdered-wig
16•andsoitis•1w ago•22 comments

Adding Breadcrumbs to a Rails Application

https://avohq.io/blog/breadcrumbs-rails
40•flow-flow•4d ago•1 comments

K8s with 1M nodes

https://bchess.github.io/k8s-1m/
149•denysvitali•2d ago•38 comments

When you opened a screen shot of a video in Paint, the video was playing in it

https://devblogs.microsoft.com/oldnewthing/20251014-00/?p=111681
187•birdculture•2d ago•26 comments

Soft multistable magnetic-responsive metamaterials

https://www.science.org/doi/10.1126/sciadv.adu3749
3•PaulHoule•3d ago•0 comments

Solution to CIA’s Kryptos sculpture is found in Smithsonian vault

https://www.nytimes.com/2025/10/16/science/kryptos-cia-solution-sanborn-auction.html
133•elahieh•2d ago•68 comments

Tinnitus Neuromodulator

https://mynoise.net/NoiseMachines/neuromodulationTonesGenerator.php
261•gjvc•12h ago•181 comments

Who invented deep residual learning?

https://people.idsia.ch/~juergen/who-invented-residual-neural-networks.html
81•timlod•5d ago•27 comments

Coral NPU: A full-stack platform for Edge AI

https://research.google/blog/coral-npu-a-full-stack-platform-for-edge-ai/
111•LER0ever•3d ago•17 comments

Satellite images show ancient hunting traps used by South American social groups

https://phys.org/news/2025-10-satellite-images-reveal-ancient-south.html
31•rntn•6d ago•6 comments

Most users cannot identify AI bias, even in training data

https://www.psu.edu/news/bellisario-college-communications/story/most-users-cannot-identify-ai-bi...
62•giuliomagnifico•10h ago•32 comments

Using Pegs in Janet

https://articles.inqk.net/2020/09/19/how-to-use-pegs-in-janet.html
14•Bogdanp•4h ago•1 comments

Moonlander.BAS

https://basic-code.bearblog.dev/moonlander/
40•ibobev•6d ago•8 comments

Picturing Mathematics

https://mathenchant.wordpress.com/2025/10/18/picturing-mathematics/
63•jamespropp•13h ago•3 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•6mo ago

Comments

returningfory2•6mo 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•6mo 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•6mo 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•6mo 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•6mo 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•6mo ago
At least you have the tools to understand where things get allocated.
38•6mo ago
instead of this:

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

    t.Buf = nil
rsc•5mo ago
Those are semantically different (one is nil and one is not) but neither allocates.
virexene•5mo 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•5mo 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