Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/myrachanto/advanced
Senior Go developers tackle complex issues like optimizing worker pools, using semaphores for safe concurrency, and custom marshaling/unmarshaling for data integrity. Solving problems like finding missing numbers or sorting anagrams requires a deep understanding of Go’s concurrency and data structures, ensuring efficient, scalable, and robust code.
https://github.com/myrachanto/advanced
algorithm algorithms golang
Last synced: 3 days ago
JSON representation
Senior Go developers tackle complex issues like optimizing worker pools, using semaphores for safe concurrency, and custom marshaling/unmarshaling for data integrity. Solving problems like finding missing numbers or sorting anagrams requires a deep understanding of Go’s concurrency and data structures, ensuring efficient, scalable, and robust code.
- Host: GitHub
- URL: https://github.com/myrachanto/advanced
- Owner: myrachanto
- Created: 2024-08-12T03:09:08.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2024-09-10T02:58:53.000Z (4 months ago)
- Last Synced: 2024-09-16T05:54:55.439Z (4 months ago)
- Topics: algorithm, algorithms, golang
- Language: Go
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# 7 ways to profile Golang Application
1. `time go fmt std` on the cmd with the file you are evaluating
2. `env GODEBUG=gctrace=1 godoc -http-:8080'
## types of profiling
- CPU profiling - involves capturing detailed information about how your program utilizes the CPU over time. It provides insights into which functions consume the most CPU time, helping developers identify performance bottlenecks and optimize their code.
- Memory profiling - records the stack trace when a heap allocation is made
- Block profiling - records the amount of time a goroutine spent waiting for a shared resource`import (
_ "net/http/pprof"
"net/http"
)func main() {
http.ListenAndServe(":8080", nil)
}`## Analyzing CPU Profile Data
`go tool pprof cpu.prof`
Common Commands:
- top: Displays the top functions by CPU usage.
- list : Shows the source code of a specific function with annotated CPU usage.
- web: Generates and opens a graphical representation of the profile in a web browser.
- svg: Creates an SVG file with a visual representation of the CPU usage.