Skip to content

Instantly share code, notes, and snippets.

View smnalex's full-sized avatar
🌴
On vacation

Alex Simion smnalex

🌴
On vacation
View GitHub Profile
@smnalex
smnalex / Dockerfile
Last active February 22, 2020 10:05
Dockerfile.ci
FROM golang:1.13.5-alpine3.10
ARG SSH_KEY
RUN apk --update add tar curl git openssh
ENV CGO_ENABLED=0
RUN go env -w GOPRIVATE=github.com/<ORG/HANDLER>/*
# Add ssh key
@smnalex
smnalex / go_cpu_memory_profiling_benchmarks.sh
Created May 26, 2019 01:37 — forked from arsham/go_cpu_memory_profiling_benchmarks.sh
Go cpu and memory profiling benchmarks. #golang #benchmark
FILENAME=$(basename $(pwd))
go test -run=. -bench=. -cpuprofile=cpu.out -benchmem -memprofile=mem.out -trace trace.out
go tool pprof -pdf $FILENAME.test cpu.out > cpu.pdf && open cpu.pdf
go tool pprof -pdf --alloc_space $FILENAME.test mem.out > alloc_space.pdf && open alloc_space.pdf
go tool pprof -pdf --alloc_objects $FILENAME.test mem.out > alloc_objects.pdf && open alloc_objects.pdf
go tool pprof -pdf --inuse_space $FILENAME.test mem.out > inuse_space.pdf && open inuse_space.pdf
go tool pprof -pdf --inuse_objects $FILENAME.test mem.out > inuse_objects.pdf && open inuse_objects.pdf
go tool trace trace.out
go-torch $FILENAME.test cpu.out -f ${FILENAME}_cpu.svg && open ${FILENAME}_cpu.svg