golang/go

crypto/cipher: optimize safeXORBytes

Ouverte

#35 381 ouverte le 5 nov. 2019

 (11 commentaires) (0 réaction) (0 personne assignée)Go (19 008 forks)batch import
NeedsInvestigationPerformanceSuggestedhelp wanted

Métriques du dépôt

Stars
 (133 883 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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

Guide contributeur