#pprof

2025-05-15

Секреты эффективного кодирования на Go для опытных и новичков: профайлинг, тесты, CI

За последние два года Go-сообщество выросло на 55% — с 3 млн до 4,7 млн разработчиков. Многие пришли в Go из других языков или только начинают свой путь в программировании. Без понимания идиоматики и ключевых особенностей языка даже опытные специалисты нередко сталкиваются с медленным кодом, дедлоками и утечками памяти. Так что сегодня разберём, как организовывать пакеты, обрабатывать ошибки, безопасно работать с горутинами и каналами, оптимизировать аллокации и профилировать «горячие» участки через pprof. Советы одинаково пригодятся и опытным Golang-разработчикам, и тем, кто только начинает свой путь в Go.

habr.com/ru/companies/netology

#golang #go #практический_гайд #профайлинг #тесты #ci #стресспаузы #pprof #less_is_more #gofmt

2025-01-13

Nothing to crack me up like #pprof on a Monday morning

Screenshot from some pprof docs stating "Flat and cumulative values are calculated as; A=4 for flat and A11 for cum.

If you want to sort based on cum value, you can type top15 -cum. You can also use sort=cum and top15 commands respectively"
2024-12-18

I've been using #pprof for a long time, but not until yesterday did I know about the "list" command. And wow, it is *amazing*. From the pprof terminal, just type "list" followed by the name of a function call the "top" command (or your flamegraph or whatever) shows as a top allocator, and you'll see exactly where in your code memory is allocated, and how much 🤯

#golang #performance #development

Screenshot showing output from the pprof list command, where memory allocations is listed next to the code where it happens.
Brandon Mitchellbmitch@fosstodon.org
2024-03-21

Finally broke down to use #pprof to debug why some of my #Golang code was slow in a test. It quickly pointed me to a completely different part of the code than I was editing. The coverage report later pointed out another hard to spot bug.

It's days like this that I really enjoy developing in Go. The strong test integration is saving me countless hours of debugging hard to spot issues in the future.

2023-08-27

I've been switching my laptop over the last week. Today got to install some old friends like #R and #ggplot2 along with the usual #golang env and check that #pprof is working.

2022-12-19

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst