gitalk icon indicating copy to clipboard operation
gitalk copied to clipboard

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

Open utterances-bot opened this issue 1 year ago • 3 comments

四种字符串和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/

utterances-bot avatar Aug 14 '24 06:08 utterances-bot

谢谢鸟窝老师,学习了👍

鸟窝老师,Go1.23 发布了

icefed avatar Aug 14 '24 06:08 icefed

Go 1.24 发布了。可否将test code归纳到仓库,每个大版本更新跑跑看?

dacapoday avatar Feb 21 '25 01:02 dacapoday

https://gist.github.com/smallnest/88efe8b969a93ed695f9c1fe1869e2f8

smallnest avatar Feb 21 '25 02:02 smallnest