←back to thread

Show HN: Go Plan9 Memo

(pehringer.info)
302 points pehringer | 1 comments | | HN request time: 0.198s | source

A quick dive into the Plan9 assembly I picked up while developing my SIMD package for Go, and how it led to a 450% performance boost in calculations.
Show context
lexh ◴[] No.41880231[source]
A bit over my head, but I enjoyed the way the writing brings us along for the ride.

This can’t be the first pass someone has made at something like this, right? There must be literal dozens of SIMD thirsty Gophers around. Would a more common pattern be to use CGO?

replies(3): >>41881085 #>>41881167 #>>41881773 #
1. Andoryuuta ◴[] No.41881773[source]
I think people certainly have been trying for a while. In fact, I recall being on a (Skype?) call with my brother almost a decade ago while he was trying to write an SIMD library in Go. If I remember correctly, at that time, a bunch of the AVX instructions weren't even encodable in Go's Plan9 assembler - so we had to manually encode them as bytes [0].

The most complete library I've seen (though admittedly never used) uses CGO _partially_, with a neat hack to avoid the overhead that it comes with [1].

[0]: https://github.com/slimsag/rand/blob/f1e8d464c0021a391d5cd64...

[1]: https://github.com/alivanz/go-simd/