logoalt Hacker News

perching_aix • today at 6:57 AM • 1 reply • view on HN

> These ten steps are as far as I could take this loop in Dart today. There is still some performance left. The good news is that I already know what it takes to get there, and I'm working on the compiler and library changes it needs. I hope they land soon, and that a future version of this post can end at full speed.

That sounds interesting. I quickly looked up the peak read of the L1D cache to be 192 GB/s, is that what's meant here? Or some other, more fundamental microarchitectural limit?

Is it possible to saturate that throughput and still have optimality to gain in some other aspect?


Replies

modulovalue • today at 7:37 AM

My goal is to safely reach native speeds on 128-bit wide SIMD registers and for that we need: - better bounds check elimination so we don't need the unsafe bounds pragma - dedicated loads so we can extract a SIMD value type directly from bytes with no overhead (Dart doesn't support slices like Rust, for example, and it's not that easy to retrofit them from what I've seen.) - a dedicated Uint8x16 type so the SWAR techniques over 32-bit wide integers are no longer needed - plus a few other minor optimizations

With that we should be pretty much be as fast as Rust, see: https://www.reddit.com/r/rust/comments/1yamcov/looking_for_f...

I don't think I'll be able to reach 192 GB/s if that's the limit of the M3 Air, but even if, unfortunately, validation is slowed down by any subsequent conversion to a String.

I should write about this because all languages suffer from this. I imagine that one day we will have languages that provide more extensive static ownership guarantees where we can have zero cost wrappers over regions of memory that we can easily treat as Strings instead of having to allocate memory and copy the bytes over to a materialized String.