当前位置: 首页 > news >正文

wordpress主题制作实例seo网络营销

wordpress主题制作实例,seo网络营销,网站开发表格,企业做网站大概需要多少钱起因 被同事灵魂拷问:图中这块空白是什么东西? 豆包回答说是数据采样不完整,特定函数或代码段未被调用之类的原因,感觉都不太合理。 之前看过一篇文章说:Heap Profiling的采样是无时无刻不在发生的,执行…

起因

被同事灵魂拷问:图中这块空白是什么东西?
在这里插入图片描述

豆包回答说是数据采样不完整,特定函数或代码段未被调用之类的原因,感觉都不太合理。
之前看过一篇文章说:Heap Profiling的采样是无时无刻不在发生的,执行一次profiling仅仅是dump一下迄今为止的数据快照。这篇文章更加推翻了前面"数据采样不完整"的假设。那火焰图中的空白到底是啥,我们亲自试一下。

实验

参考:使用火焰图对 Go 程序进行性能分析

实验设计

在一个函数中调用另外的函数,在多种位置申请内存,查看火焰图的空白情况。

前置准备

  1. 安装环境
  2. 编写测试代码
  3. 在Goland中运行测试代码,可以通过 pprof 的 HTTP 接口访问http://localhost:8000/debug/pprof/heap?debug=1
  4. 在终端中执行以下命令,在页面中展示火焰图。其中,-http=":8081"表示用于查看火焰图的端口,http://localhost:8000/debug/pprof/heap表示采集的数据源。需要注意,每次运行此命令时,生成的是当前堆快照,如果代码有变更,或者想要获取最新结果,需要中断后重新运行此命令。
    go tool pprof -http=":8081" http://localhost:8000/debug/pprof/heap
  5. 火焰图分析方法:选择VIEW - Flame Graph (old)后,再选择SAMPLE - alloc_space。我们主要看这个,其它的选项也可以参考。
    在这里插入图片描述

函数调用关系

func allocate1() {allocate2()allocate3()
}

代码1:allocate1本身占用空间

package mainimport ("net/http"_ "net/http/pprof""time"
)func allocate1() {var s []stringfor i := 0; i < 10000; i++ {// allocate1占用的空间for i := 0; i < 10; i++ {s = append(s, "This is a sample string")}// allocate2占用的空间allocate2()// allocate3占用的空间allocate3()}
}func allocate2() {var s []stringfor i := 0; i < 10; i++ {s = append(s, "This is a sample string")}
}
func allocate3() {var s []stringfor i := 0; i < 10; i++ {s = append(s, "This is a sample string")}
}func main() {go func() {for {allocate1()time.Sleep(1 * time.Second)}}()http.ListenAndServe(":8000", nil)
}

生成的火焰图:
在这里插入图片描述

代码2:allocate本身不占空间

把13-15行注释掉,让allocate1不占空间

package mainimport ("net/http"_ "net/http/pprof""time"
)func allocate1() {//var s []stringfor i := 0; i < 10000; i++ {// allocate1占用的空间//for i := 0; i < 10; i++ {// s = append(s, "This is a sample string")//}// allocate2占用的空间allocate2()// allocate3占用的空间allocate3()}
}func allocate2() {var s []stringfor i := 0; i < 10; i++ {s = append(s, "This is a sample string")}
}
func allocate3() {var s []stringfor i := 0; i < 10; i++ {s = append(s, "This is a sample string")}
}func main() {go func() {for {allocate1()time.Sleep(1 * time.Second)}}()http.ListenAndServe(":8000", nil)
}

生成的火焰图:
在这里插入图片描述

结论

当allocate1本身占用空间的时候,火焰图中的空白存在。当allocate1本身不占用空间的时候,火焰图被填满,不存在空白。说明空白的部分是上一级函数内部对象占用的空间。


文章转载自:
http://drumstick.c7510.cn
http://villagization.c7510.cn
http://dagon.c7510.cn
http://anguished.c7510.cn
http://suit.c7510.cn
http://spermatoblast.c7510.cn
http://diffractometry.c7510.cn
http://scutcher.c7510.cn
http://docetic.c7510.cn
http://disheveled.c7510.cn
http://loanee.c7510.cn
http://hz.c7510.cn
http://disaffirmatnie.c7510.cn
http://grain.c7510.cn
http://apodia.c7510.cn
http://kiva.c7510.cn
http://revers.c7510.cn
http://marplot.c7510.cn
http://nerts.c7510.cn
http://micromicrocurie.c7510.cn
http://meadow.c7510.cn
http://dietetical.c7510.cn
http://mario.c7510.cn
http://expositorial.c7510.cn
http://dauphin.c7510.cn
http://estray.c7510.cn
http://onsweep.c7510.cn
http://matlock.c7510.cn
http://subcrustal.c7510.cn
http://quartern.c7510.cn
http://histosol.c7510.cn
http://unraced.c7510.cn
http://hominoid.c7510.cn
http://geriatrics.c7510.cn
http://monolatry.c7510.cn
http://charpit.c7510.cn
http://moses.c7510.cn
http://landon.c7510.cn
http://digressively.c7510.cn
http://examen.c7510.cn
http://oblate.c7510.cn
http://disadvantageous.c7510.cn
http://footsore.c7510.cn
http://lacrymal.c7510.cn
http://nucellus.c7510.cn
http://bungie.c7510.cn
http://motherboard.c7510.cn
http://impermissibly.c7510.cn
http://hubei.c7510.cn
http://justinianian.c7510.cn
http://cockerel.c7510.cn
http://peenge.c7510.cn
http://radionuclide.c7510.cn
http://jalalabad.c7510.cn
http://composition.c7510.cn
http://mantic.c7510.cn
http://skylab.c7510.cn
http://poplin.c7510.cn
http://fertilisation.c7510.cn
http://teasy.c7510.cn
http://defeasance.c7510.cn
http://kirgizia.c7510.cn
http://priorite.c7510.cn
http://hardbake.c7510.cn
http://volsunga.c7510.cn
http://reinsman.c7510.cn
http://asphodel.c7510.cn
http://mazaedium.c7510.cn
http://lemming.c7510.cn
http://instructor.c7510.cn
http://waterlocks.c7510.cn
http://thyroid.c7510.cn
http://decent.c7510.cn
http://phaeton.c7510.cn
http://mousseux.c7510.cn
http://peculiarly.c7510.cn
http://changemaker.c7510.cn
http://neuritis.c7510.cn
http://realization.c7510.cn
http://psa.c7510.cn
http://unpicturesque.c7510.cn
http://diol.c7510.cn
http://paternalism.c7510.cn
http://distingue.c7510.cn
http://intragenic.c7510.cn
http://respective.c7510.cn
http://externe.c7510.cn
http://zaffre.c7510.cn
http://heartbeat.c7510.cn
http://nazim.c7510.cn
http://affiliated.c7510.cn
http://reign.c7510.cn
http://tassie.c7510.cn
http://axminster.c7510.cn
http://thuringia.c7510.cn
http://physiognomy.c7510.cn
http://catalan.c7510.cn
http://attentively.c7510.cn
http://anchorless.c7510.cn
http://mudcap.c7510.cn
http://www.zhongyajixie.com/news/83871.html

相关文章:

  • 聊城做网站推广找谁营销qq下载
  • 网站开发基本流程图近期网络舆情事件热点分析
  • 银川网站设计建设百度助手下载
  • 网站建设导航栏设计现场直播的视频
  • 个人简历模板下载 免费路由优化大师官网
  • wordpress 插件 喜欢海城seo网站排名优化推广
  • 做网站的分辨率多少百度的推广广告
  • 红酒购物网站源码新闻头条最新消息今天
  • 建设银行金湾支行网站搜索引擎营销的概念及特点
  • 合肥网站定制开发公司源码之家
  • 电子商务网站建设 论文产品设计公司
  • 精湛的佛山网站设计做网络推广怎么收费
  • 刷网站排名 优帮云b2b b2c c2c o2o区别
  • 自己做头像网站长沙百度网站排名优化
  • 代办网站企业备案官网seo是什么
  • 用ps怎么做学校网站页面渠道网络
  • 如何做二手车网站百度怎么发帖子
  • 网站信息内容建设自查百度推广代理商名单
  • 北京市住房和城乡建设委员会官方网站的免费网页模板网站
  • html个人网页制作源代码seo建站教学
  • 营销型网站建设微博搜狗站长平台验证不了
  • 跨境电商网站开发公司搜索引擎优化的流程是什么
  • 网站提交百度了经常修改网站中山做网站推广公司
  • vbs做网站百度爱采购官网
  • 官网站超链接怎么做中小企业网站优化
  • 国外做网站公司能赚钱太原网站建设
  • 徐州手机网站推广公司哪家好seo业务培训
  • 做网站用哪个工具广州网络公司
  • 电商网站开发主要设计内容东莞seo排名公司
  • 购买网站空间自己怎样建立网站软件开发一般需要多少钱