smallnest / gitalk

gitalk for colobu
19 stars 0 forks source link

四种字符串和bytes互相转换方式的性能比较 #306

Open utterances-bot opened 4 weeks ago

utterances-bot commented 4 weeks ago

四种字符串和bytes互相转换方式的性能比较

昨天公司群中同事提到 Go 1.22 中 string 和 bytes 的互转不需要再用 unsafe 那个包了,直接转就可以。我翻看了 Go 1.22 的 release notes 没找到相应的介绍,但是大家提到了 kubernetes 的 issue 中有这个说法:

As of go 1.22, for string to bytes conversion, we can replace

https://colobu.com/2024/08/13/string-bytes-benchmark/

icefed commented 4 weeks ago

谢谢鸟窝老师,学习了👍

鸟窝老师,Go1.23 发布了