Skip to content

Instantly share code, notes, and snippets.

View vallerion's full-sized avatar
🎯
Focusing

Valeriy vallerion

🎯
Focusing
View GitHub Profile
@vallerion
vallerion / go_cpu_memory_profiling_benchmarks.sh
Created March 30, 2022 11:49 — forked from arsham/go_cpu_memory_profiling_benchmarks.sh
Go cpu and memory profiling benchmarks. #golang #benchmark
go test -run=. -bench=. -benchtime=5s -count 5 -benchmem -cpuprofile=cpu.out -memprofile=mem.out -trace=trace.out ./package | tee bench.txt
go tool pprof -http :8080 cpu.out
go tool pprof -http :8081 mem.out
go tool trace trace.out
go tool pprof $FILENAME.test cpu.out
# (pprof) list <func name>
# go get -u golang.org/x/perf/cmd/benchstat
benchstat bench.txt
@vallerion
vallerion / remove-all-from-docker.sh
Created August 14, 2018 06:30 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
docker stop $(docker ps -qa) && docker rm $(docker ps -qa)
# Remove all images
docker rmi -f `docker images -qa `
86937 isset
43159 echo
31697 empty
29252 substr
26146 count
24248 is_array
22572 strlen
19365 sprintf
18090 unset
16584 str_replace