Skip to content

Instantly share code, notes, and snippets.

Stan Nelson eleniums

Block or report user

Report or block eleniums

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@eleniums
eleniums / Makefile
Created Sep 20, 2018
Sample Go Makefile to build binaries for Windows, Mac, and Linux.
View Makefile
EXECUTABLE=executable-name
WINDOWS=$(EXECUTABLE)_windows_amd64.exe
LINUX=$(EXECUTABLE)_linux_amd64
DARWIN=$(EXECUTABLE)_darwin_amd64
VERSION=$(shell git describe --tags --always --long --dirty)
.PHONY: all test clean
all: test build ## Build and run tests
@eleniums
eleniums / test_bench.sh
Last active May 4, 2019
Script to run benchmarks for Go.
View test_bench.sh
#!/bin/bash
set -e
if [ -z "$BENCH_TIME" ]
then
export BENCH_TIME=10s
fi
if [ -z "$BENCH" ]
then
@eleniums
eleniums / pprof_mem.sh
Created May 4, 2019
Script to run pprof for a memory profile.
View pprof_mem.sh
#!/usr/bin/env bash
set -e
# INSTRUCTIONS:
# Run benchmark tests first (test_bench.sh) to generate a memory profile.
# First parameter of this script is the index to use (alloc_space, alloc_objects, inuse_space, or inuse_objects).
# Alloc indexes track total allocations over time. Inuse tracks current in-memory usage.
# USEFUL PPROF COMMANDS:
# top - Outputs the top entries (can also do top10 or top20 or topN where N is any number to limit results).
@eleniums
eleniums / pprof_cpu.sh
Created May 4, 2019
Script to run pprof for a cpu profile.
View pprof_cpu.sh
#!/usr/bin/env bash
set -e
# INSTRUCTIONS:
# Run benchmark tests first (test_bench.sh) to generate a cpu profile.
# First parameter of this script is the index to use (samples or cpu).
# USEFUL PPROF COMMANDS:
# top - Outputs the top entries (can also do top10 or top20 or topN where N is any number to limit results).
# list - Shows method code with flat and cum values.
You can’t perform that action at this time.