psanford / wormhole-william

End-to-end encrypted file transfer. A magic wormhole CLI and API in Go (golang).
MIT License
1.07k stars 54 forks source link

Use hex.EncodeToString for faster hex encoding #73

Closed Jacalz closed 2 years ago

Jacalz commented 2 years ago

Benchmarks indicate the encoding is 35% faster and allocates 30% less memory. There were a few places in https://github.com/psanford/wormhole-william/blob/cb9dbf21814d1cbebc487b9471a32f5cae195cca/wormhole/file_transport.go that could also be switched over but the string concatenation resulted in the old way being faster for those.