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

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

查看所有标签

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

Ruby Cookbook

Ruby Cookbook

Lucas Carlson、Leonard Richardson / O'Reilly Media / 2006-7-29 / USD 49.99

Do you want to push Ruby to its limits? The "Ruby Cookbook" is the most comprehensive problem-solving guide to today's hottest programming language. It gives you hundreds of solutions to real-world pr......一起来看看 《Ruby Cookbook》 这本书的介绍吧!

SHA 加密
SHA 加密

SHA 加密工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具