frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

How much slower is random access, really?

https://samestep.com/blog/random-access/
42•sestep•3d ago

Comments

Adhyyan1252•4h ago
Love this analysis! Was expecting random to be much slower. 4x is not bad at all
andersa•3h ago
Note this is not true random access in the manner it occurs in most programs. By having a contiguous array of indices to look at, that array can be prefetched as it goes, and speculative execution will take care of loading many upcoming indices of the target array in parallel.

A more interesting example might be if each slot in the target array has the next index to go to in addition to the value, then you will introduce a dependency chain preventing this from happening.

jiggawatts•2h ago
This is why array random access and linked-list random access have wildly different performance characteristics.

Another thing I noticed is that the spike on the left hand side of his graphs is the overhead of file access.

Without this overhead, small array random access should have a lot better per-element cost.

wtallis•25m ago
> A more interesting example might be if each slot in the target array has the next index to go to in addition to the value, then you will introduce a dependency chain preventing this from happening.

However, on some processors there's a data-dependent prefetcher that will notice the pointer-like value and start prefetching that address before the CPU requests it.

forrestthewoods•3h ago
Here’s an older blog post of mine on roughly the same topic:

https://www.forrestthewoods.com/blog/memory-bandwidth-napkin...

I’m not sure I agree with the data presentation format. “time per element” doesn’t seem like the right metric.

klank•1h ago
What are your qualms with time per element? I liked it as a metric because it kept the total deviation of results to less than 32 across the entire result set.

Using something like the overall run length would have such large variations making only the shape of the graph particularly useful (to me) less so much the values themselves.

If I was showing a chart like this to "leadership" I'd show with the overall run length. As I'd care more about them realizing the "real world" impact rather than the per unit impact. But this is written for engineers, so I'd expect it to also be focused on per unit impacts for a blog like this.

However, having said all that, I'd love to hear what your reservations are using it as a metric.

alain94040•1h ago
From your blog post:

> Random access from the cache is remarkably quick. It's comparable to sequential RAM performance

That's actually expected once you think about it, it's a natural consequence of prefetching.

porcoda•2h ago
The RandomAccess (or GUPS) benchmark (see: https://ieeexplore.ieee.org/document/4100365) was looking at measuring machines on this kind of workload. In high performance computing this was important for graph calculations and was one of the things the Cray (formerly Tera) MTA machine was particularly good at. I suppose this benchmark wouldn’t be very widely known outside HPC circles.
FpUser•25m ago
I did another type of experiment which evaluates benefits of branch prediction on AMD 9950X on contiguous array with 1,000,000 elements. Calculated sum adding element if it is bigger than 125 (50% of 256). Difference between random and sorted was 10 times. I guess branch prediction plays a huge role as well.
Andys•18m ago
Thanks for sharing that.

Presumably if you'd split the elements into 16 shares (one for each CPU), summed with 16 threads, and then summed the lot at the end, then random would be faster than sorted?

AlphaGenome: AI for better understanding the genome

https://deepmind.google/discover/blog/alphagenome-ai-for-better-understanding-the-genome/
380•i_love_limes•12h ago•114 comments

A lumberjack created more than 200 sculptures in Wisconsin's Northwoods

https://www.smithsonianmag.com/travel/when-a-lumberjacks-imagination-ran-wild-he-created-more-than-200-sculptures-in-wisconsins-northwoods-180986840/
12•noleary•41m ago•5 comments

Launch HN: Issen (YC F24) – Personal AI language tutor

227•mariano54•12h ago•206 comments

The time is right for a DOM templating API

https://justinfagnani.com/2025/06/26/the-time-is-right-for-a-dom-templating-api/
89•mdhb•7h ago•49 comments

Alternative Layout System

https://alternativelayoutsystem.com/scripts/#same-sizer
135•smartmic•7h ago•16 comments

Kea 3.0, our first LTS version

https://www.isc.org/blogs/kea-3-0/
58•conductor•6h ago•21 comments

How much slower is random access, really?

https://samestep.com/blog/random-access/
42•sestep•3d ago•10 comments

Collections: Nitpicking Gladiator's Iconic Opening Battle, Part I

https://acoup.blog/2025/06/06/collections-nitpicking-gladiators-iconic-opening-battle-part-i/
11•diodorus•3d ago•0 comments

Fault Tolerant Llama training

https://pytorch.org/blog/fault-tolerant-llama-training-with-2000-synthetic-failures-every-15-seconds-and-no-checkpoints-on-crusoe-l40s/
29•Mougatine•3d ago•5 comments

Show HN: Magnitude – Open-source AI browser automation framework

https://github.com/magnitudedev/magnitude
62•anerli•8h ago•28 comments

Dickinson's Dresses on the Moon

https://www.theparisreview.org/blog/2025/06/20/dickinsons-dresses-on-the-moon/
12•Bluestein•3d ago•0 comments

Thomas Aquinas – The world is divine

https://ralphammer.com/thomas-aquinas-the-world-is-divine/
14•pedroth•3h ago•4 comments

Snow - Classic Macintosh emulator

https://snowemu.com/
208•ColinWright•17h ago•75 comments

A new pyramid-like shape always lands the same side up

https://www.quantamagazine.org/a-new-pyramid-like-shape-always-lands-the-same-side-up-20250625/
623•robinhouston•1d ago•152 comments

A Review of Aerospike Nozzles: Current Trends in Aerospace Applications

https://www.mdpi.com/2226-4310/12/6/519
71•PaulHoule•11h ago•32 comments

Puerto Rico's Solar Microgrids Beat Blackout

https://spectrum.ieee.org/puerto-rico-solar-microgrids
348•ohjeez•1d ago•201 comments

Matrix v1.15

https://matrix.org/blog/2025/06/26/matrix-v1.15-release/
132•todsacerdoti•6h ago•42 comments

Introducing Gemma 3n

https://developers.googleblog.com/en/introducing-gemma-3n-developer-guide/
293•bundie•9h ago•132 comments

Show HN: I built an AI dataset generator

https://github.com/metabase/dataset-generator
121•matthewhefferon•11h ago•24 comments

SigNoz (YC W21, Open Source Datadog) Is Hiring DevRel Engineers (Remote)(US)

https://www.ycombinator.com/companies/signoz/jobs/cPaxcxt-devrel-engineer-remote-us-time-zones
1•pranay01•7h ago

Shifts in diatom and dinoflagellate biomass in the North Atlantic over 6 decades

https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0323675
45•PaulHoule•9h ago•2 comments

Typr – TUI typing test with a word selection algorithm inspired by keybr

https://github.com/Sakura-sx/typr
42•Sakura-sx•3d ago•30 comments

Starcloud can’t put a data centre in space at $8.2M in one Starship

https://angadh.com/space-data-centers-1
59•angadh•6h ago•72 comments

The Business of Betting on Catastrophe

https://thereader.mitpress.mit.edu/the-business-of-betting-on-catastrophe/
67•anarbadalov•3d ago•31 comments

Ambient Garden

https://ambient.garden
317•fipar•3d ago•56 comments

Lateralized sleeping positions in domestic cats

https://www.cell.com/current-biology/fulltext/S0960-9822(25)00507-X?_returnURL=https%3A%2F%2Flinkinghub.elsevier.com%2Fretrieve%2Fpii%2FS096098222500507X%3Fshowall%3Dtrue
107•EvgeniyZh•8h ago•50 comments

Show HN: PRSS Site Creator – Create Blogs and Websites from Your Desktop

https://prss.co/
6•volted•5h ago•2 comments

Memory safety is table stakes

https://www.usenix.org/publications/loginonline/memory-safety-merely-table-stakes
68•comradelion•7h ago•72 comments

“My Malformed Bones” – Harry Crews’s Counterlives

https://harpers.org/archive/2025/07/my-malformed-bones-charlie-lee-harry-crews/
9•Caiero•3d ago•0 comments

Writing a basic Linux device driver when you know nothing about Linux drivers

https://crescentro.se/posts/writing-drivers/
426•sbt567•4d ago•60 comments