Posted in

切片vs数组,性能差37倍?实测10万次操作对比数据,Go面试必问的3个内存布局细节

第一章:Go语言切片的核心概念与 … 切片vs数组,性能差37倍?实测10万次操作对比数据,Go面试必问的3个内存布局细节Read more

Posted in

Go读取WebSocket消息的粘包/半包处理:3种buffer管理模型对比(ring buffer vs slice pool vs bytes.Buffer)

第一章:Go读取WebSocke … Go读取WebSocket消息的粘包/半包处理:3种buffer管理模型对比(ring buffer vs slice pool vs bytes.Buffer)Read more

Posted in

Go内存安全对比图谱(unsafe.Pointer vs reflect vs slice header):6种指针操作在Go 1.20+的兼容性红绿灯

第一章:Go内存安全对比图谱总览 … Go内存安全对比图谱(unsafe.Pointer vs reflect vs slice header):6种指针操作在Go 1.20+的兼容性红绿灯Read more

Posted in

为什么Go的for range slice会复用底层数组?——从2道题切入,用unsafe.Pointer验证内存复用本质

第一章:为什么Go的for ra … 为什么Go的for range slice会复用底层数组?——从2道题切入,用unsafe.Pointer验证内存复用本质Read more