1. CAP理论 2. Base理论 1. CAP理论 cap理论是分布式系统的理论基石Consistency (一致性): “all nodes see the same data at the same time”,即更新操作成功并返回客户端后,所有节点在同一时间的数据完全一致,这就是分布式的一致性。一致性的问题在并发系统中不可避免,对于客户端...
Go 如何查看GC信息? 1. GODEBUG=‘gctrace=1’ 2. go tool trace 3. debug.ReadGCStats 4. runtime.ReadMemStats Go 如何查看GC信息? 1. GODEBUG=‘gctrace=1’ package main func main () { f...
go test test 和 benchmark go test test 和 benchmark 题目来源:字节跳动 答案1: Go语言中自带有一个轻量级的测试框架testing 和自带的go test 命令来实现单元测试和性能测试。 go test 由于go test 命令只能在一个相应的目录下执行所有文件,例如,新建一个项目目...