golang/go

crypto/cipher: optimize safeXORBytes

开放

#35,381 创建于 2019年11月5日

 (11 条评论) (0 个反应) (0 位负责人)Go (19,008 个派生)batch import
NeedsInvestigationPerformanceSuggestedhelp wanted

仓库指标

星标
 (133,883 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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

贡献者指南