2017-06-28 15:38
浏览 41


I'm currently working on a Go program that loads data from a database, runs some calculations and then saves the results to the same database. There are multiple gorutines.

The runtime (5-6 minutes) was surprisingly long. Following this article I performed CPU profiling and it turns out that 70%+ of the CPU time is Garbage Collection related code running.

Now, I tried memory profiling but none of my my code appears in the results. This is my first time profiling a program - I don't know how to proceed with optimisation of the program or where to look for problems. I appreciate any help.

enter image description here

Thanks in advance!

图片转代码服务由CSDN问答提供 功能建议

我目前正在使用Go程序,该程序从数据库加载数据,运行一些计算,然后保存结果 到同一个数据库。 有许多gorutines。

运行时间(5-6分钟)非常长。 遵循此文章我执行了CPU性能分析,结果发现70%以上的CPU时间是与垃圾回收相关的代码正在运行。

现在,我尝试了内存分析,但是我的代码都没有出现在结果中。 这是我第一次对程序进行性能分析-我不知道如何进行程序优化或在哪里查找问题。 感谢您的帮助。



  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题