encoding/binary: Write does not optimise the case of native-format slices #70503
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
Go version
go version go1.23.3 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I wrote a (large) number of slices of little-endian IEEE floats using
binary.Write
on a little-endian machine. I was expecting the library to recognise that I was writing in the native format, and special-case the write. However, it did not, and the performance was about 3000 slower than expected.https://go.dev/play/p/wNWegxHXjlG
What did you see happen?
What did you expect to see?
I was expecting the performance of the two implementations to be similar.
The text was updated successfully, but these errors were encountered: