Cpu-profiling - Basic example of CPU Profiling in Golang which shows the bottlenecks and how much time is spent per function

Overview

cpu-profiling

Basic example of CPU Profiling in Golang which shows the bottlenecks and how much time is spent per function

Generate cpu.prof

Run the following command to create the cpu.prof file

go test -cpuprofile cpu.prof -bench .=

Analyze functions

First connect to pprof by running the command go tool pprof cpu.prof

Then, run the list command followed by the function name

list nonDivisibleSubset

list generateSubset

list updateSubset

You might also like...
keeper is package for Go that provides a mechanism for waiting a result of execution function until context cancel.

keeper is package for Go that provides a mechanism for waiting a result of execution function until context cancel.

A helper function to create a pointer to a new object in Go 1.18+
A helper function to create a pointer to a new object in Go 1.18+

A helper function to create a pointer to a new object in Go 1.18+

Graceful - shutdown package when a service is turned off by software function

graceful Graceful shutdown package when a service is turned off by software func

The main goal of this code is to create a basic dnstap printing tool based on the golang-dnstap library.

dnstap-parse The main goal of this code is to create a basic dnstap printing tool based on the golang-dnstap library. The output is supposed to mimic

Goridge is high performance PHP-to-Golang codec library which works over native PHP sockets and Golang net/rpc package.
Goridge is high performance PHP-to-Golang codec library which works over native PHP sockets and Golang net/rpc package.

Goridge is high performance PHP-to-Golang codec library which works over native PHP sockets and Golang net/rpc package. The library allows you to call Go service methods from PHP with a minimal footprint, structures and []byte support.

🍀 Go basic library. || Go语言基础库
🍀 Go basic library. || Go语言基础库

Go语言基础库 工程目录说明 pkg/ ...... 源码包 |-- bininfo/ ...... 将编译时源码的git版本信息(当前commit log的sha值和commit message),编译时间,Go版本,平台打入程序中

Minimalistic library for basic matrix operations.

MATRIX Maybe a bit slow, but minimalistic library for basic matrix operations. Available functions Function signature Description Equal(a, b [][]float

Meteoric golang nitro sniper, 0.1/0.5s claim time.
Meteoric golang nitro sniper, 0.1/0.5s claim time.

Meteoric golang nitro sniper, 0.1/0.5s claim time.

Optimal implementation of ordered maps for Golang - ie maps that remember the order in which keys were inserted.

Goland Ordered Maps Same as regular maps, but also remembers the order in which keys were inserted, akin to Python's collections.OrderedDicts. It offe

Owner
Felipe Azevedo
Hey there! Welcome to my Github! I'm a Back-End Software Engineer with over 5 years of experience. Feel free to reach me out :)
Felipe Azevedo
How much you spend for glovo. Make config file and launch yourself

how_much_you_spend How much you spend for glovo. Make config file and launch yourself, you are welcome! Put config file in the same folder as executab

null 0 Nov 9, 2021
libraries for various programming languages that make it easy to generate per-process trace files that can be loaded into chrome://tracing

chrometracing: chrome://tracing trace_event files The chrometracing directory contains libraries for various programming languages that make it easy t

Google 23 Oct 6, 2022
perfessor - Continuous Profiling Sidecar

perfessor - Continuous Profiling Sidecar About Perfessor is a continuous profiling agent that can profile running programs using perf It then converts

null 56 Sep 28, 2022
Simple profiling for Go

profile Simple profiling for Go. Easy management of Go's built-in profiling and tracing Based on the widely-used pkg/profile: mostly-compatible API Su

Michael McLoughlin 71 Sep 23, 2022
CPU feature identification for Go

cpuid Package cpuid provides information about the CPU running the current program. CPU features are detected on startup, and kept for fast access thr

Klaus Post 790 Dec 29, 2022
Automatically set GOMAXPROCS to match Linux container CPU quota.

automaxprocs Automatically set GOMAXPROCS to match Linux container CPU quota. Installation go get -u go.uber.org/automaxprocs Quick Start import _ "go

Uber Go 2.4k Dec 29, 2022
gProfiler combines multiple sampling profilers to produce unified visualization of what your CPU

gProfiler combines multiple sampling profilers to produce unified visualization of what your CPU is spending time on, displaying stack traces of your processes across native programs1 (includes Golang), Java and Python runtimes, and kernel routines.

Granulate 598 Dec 27, 2022
A program to create assembly 8086 strings to print without using any printing/strings related function but only mov-xchg-int and loops

Assembly String builder tool A program to create assembly 8086 strings to print without using any printing/strings related function but only mov-xchg-

Reg 2 Feb 1, 2022
A comprehensive, efficient, and reusable util function library of go.

Lancet Lancet is a comprehensive, efficient, and reusable util function library of go. Inspired by the java apache common package and lodash.js. Engli

Beyond 1.9k Jan 8, 2023
Reload Go code in a running process at function/method level granularity

got reload? Function/method-level stateful hot reloading for Go! Status Very much work in progress.

null 34 Nov 9, 2022