A Geiger counter for allocations

geiger

GoDoc Go Report Card

go get lukechampine.com/geiger

Inspired by this tweet. Just call go geiger.Count() at the top of your main function. Don't worry, if you start tasting metal, you're probably just delusional.

This package is in a pretty unpolished state. First of all, it emits a constant tone, not a series of clicks like a real Geiger counter, because I couldn't figure out how to get the beep package to click the way I wanted. (EDIT: fixed, thanks @klauspost!) Second, the package itself incurs a non-zero number of allocations per second (~100 on MacOS, presumably different on other platforms) which throws off the reading. Third, it's completely unconfigurable: you can't adjust the "sensitivity," and you can only measure the number of objects allocated per second (as opposed to, e.g., the number of bytes allocated per second).

Still, I think the general idea of "use sound to alert the programmer that they're doing something stupid" has merit. If enough people agree, maybe we can work together to refine it into an actually useful tool.

Troubleshooting

This package uses beep to play audio. If you can't hear anything, please check the beep issue tracker (and open issues there, if necessary) rather than on this repo. I know basically nothing about audio interfaces, so I'm not going to be able to help you!

Owner
Luke Champine
"If the world were perfect, it wouldn't be." - Yogi Berra
Luke Champine
Similar Resources

Sloc, Cloc and Code: scc is a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go

Sloc, Cloc and Code: scc is a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go

Sloc Cloc and Code (scc) A tool similar to cloc, sloccount and tokei. For counting physical the lines of code, blank lines, comment lines, and physica

Jan 8, 2023

Sloc, Cloc and Code: scc is a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go

Sloc, Cloc and Code: scc is a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go

Sloc Cloc and Code (scc) A tool similar to cloc, sloccount and tokei. For counting physical the lines of code, blank lines, comment lines, and physica

Jan 4, 2023

Various implementations of a go-routine safe counter

Shared Counter Implementations Not Safe Counter Mutex Counter Channel Counter Atomic Counter Compare and Swap Counter Compare and Swap Float Counter T

Sep 2, 2022

An atomic counter that also tracks and calculates a rate written in Go.

An atomic counter that also tracks and calculates a rate written in Go.

Oct 27, 2021

Issue Reaction Counter with golang

Below is the title and reaction count for issues filed in this repository

Oct 26, 2022

IP Counter Demo

IP Counter Demo This is a demo of maintaining counts of IP hits and a top 100 list of the IPs with the most hits. How to Run $ go build # macOS or Lin

Nov 25, 2021

TTAK.KO-12.0223 Lightweight Encryption Algorithm with Galois/Counter Mode (LEA-GCM)

LEACrypt The Lightweight Encryption Algorithm (also known as LEA) is a 128-bit block cipher developed by South Korea in 2013 to provide confidentialit

Dec 16, 2022

Shared counter (with max limit) for k6 load testing tool

xk6-increment This is a k6 extension using the xk6 system. ❗ This is a proof of concept, isn't supported by the k6 team, and may break in the future.

Nov 30, 2021

Basic implementation of WhatsApp message counter by participant.

Whatsapp Group Message Counter This is a learning project to get familiar with some topics related to Golang. make sure to have your exported file on

Dec 23, 2021

This repository includes consumer driven contract test for provider, unit test and counter api.

This repository includes consumer driven contract test for provider, unit test and counter api.

Feb 1, 2022
Comments
  • Use modules

    Use modules

    This PR updates the package to use Go modules.

    Since the module system has been safe for legacy GOPATH projects since 1.13.x, this should be a non-destructive update, and is more friendly to modern Go development environments.

  • Missing dependencies information

    Missing dependencies information

    # pkg-config --cflags  -- alsa
    Package alsa was not found in the pkg-config search path.
    Perhaps you should add the directory containing `alsa.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'alsa' found
    pkg-config: exit status 1
    

    Please add information about libasound2-dev to README.md.

  • Add more geiger

    Add more geiger

    While the current implementation does well for emulating an avant-garde synthesizer theme the package name is a bit misleading. I attempt to fix that.

    Other than that, this also adds a baseline to sort of account for the allocations by the application itself.

    "Test" added. Confirmed it sorta-kinda works.

Related tags
Generic Free List implementation to reuse memory and avoid allocations

gofl GOFL provides a Generic Free List implementation for Go. Installation This

Oct 17, 2022
A simple project (which is visitor counter) on kubernetesA simple project (which is visitor counter) on kubernetes

k8s playground This project aims to deploy a simple project (which is visitor counter) on kubernetes. Deploy steps kubectl apply -f secret.yaml kubect

Dec 16, 2022
efaceconv - Code generation tool for high performance conversion from interface{} to immutable type without allocations.

efaceconv High performance conversion from interface{} to immutable types without additional allocations This is tool for go generate and common lib (

May 14, 2022
Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http
Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http

fasthttp Fast HTTP implementation for Go. Currently fasthttp is successfully used by VertaMedia in a production serving up to 200K rps from more than

Jan 5, 2023
Fast, powerful, yet easy to use template engine for Go. Optimized for speed, zero memory allocations in hot paths. Up to 20x faster than html/template

quicktemplate A fast, powerful, yet easy to use template engine for Go. Inspired by the Mako templates philosophy. Features Extremely fast. Templates

Dec 26, 2022
Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http
Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http

fasthttp Fast HTTP implementation for Go. Currently fasthttp is successfully used by VertaMedia in a production serving up to 200K rps from more than

Jan 2, 2023
Find functions that return a reference and cause allocations.

refreturn Find functions that return a reference and cause allocations. When a function allocates a value and returns a reference to it, the value has

Aug 22, 2022
Watch Nomad allocations and update logshipper config

Nomad Logger This is a simple Go application that polls the Nomad API for all al

Apr 9, 2022
Generic Free List implementation to reuse memory and avoid allocations

gofl GOFL provides a Generic Free List implementation for Go. Installation This

Oct 17, 2022
Dynatomic is a library for using dynamodb as an atomic counter

Dynatomic Dynatomic is a library for using dynamodb as an atomic counter Dynatomic Motivation Usage Development Contributing Motivation The dynatomic

Sep 26, 2022