golang/go

crypto/cipher: optimize safeXORBytes

Offen

#35.381 geöffnet am 05.11.2019

 (11 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Go (19.008 Forks)batch import
NeedsInvestigationPerformanceSuggestedhelp wanted

Repository-Metriken

Stars
 (133.883 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

The discussion at https://github.com/golang/go/issues/31586 includes several techniques for optimizing xor of byte slices, including using encoding/binary (with native endianness) and loop unrolling. It'd be nice to apply them to safeXORBytes, which is used on many non-amd64 platforms. An optimized safeXORBytes might even be fast enough that we could delete fastXORBytes.

Somewhat related: #30553

cc @nhooyr

Contributor Guide