Go tooling in action

栏目: Go · 发布时间: 7年前

内容简介:主要介绍了一下命令工具,最后用profile做了个webserver的优化先profile,再调优。收集到详细可信的数据,问题即使不能解决,至少清楚在哪里了。

大胡子小哥教go

youtube channel

go tooling in action

主要介绍了一下命令工具,最后用profile做了个webserver的优化

  1. Command
go list -f '{{ join .Imports "\n"}}'
go list -f '{{ join .Imports "\n"}}' log

go doc fmt
go doc fmt printf
godoc -http :6060

go tool vet
  1. debug daemon

  2. test

    table driven test

    直接发请求测试

  3. 用火焰图调优

go-wrk
go tool pprof
go-torch
go test bench
  • 正则表达式build一次
  • 不用正则表达式
  • set http header type

感想

先profile,再调优。收集到详细可信的数据,问题即使不能解决,至少清楚在哪里了。

关于daemon到讨论很有意思

https://github.com/golang/go/issues/227

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Distributed Algorithms: An Intuitive Approach

Distributed Algorithms: An Intuitive Approach

Wan Fokkink / MIT Press / 2018-2-2 / USD 48.00

The new edition of a guide to distributed algorithms that emphasizes examples and exercises rather than the intricacies of mathematical models. This book offers students and researchers a guide to ......一起来看看 《Distributed Algorithms: An Intuitive Approach》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

URL 编码/解码
URL 编码/解码

URL 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具