buarki

viztruct

Visit
Portolio overview

Description

viztruct is a fun little project I created to expose the hidden memory inefficiencies in Go struct definitions. It turns out field ordering matters a lot - your structs could be wasting tons of memory without you even noticing! I built this to make padding visible and show how much space you could save with a simple reordering.

The tool takes your Go struct definitions and generates slick visual diagrams showing both the original and optimized memory layouts. I initially built it as a CLI tool, but later compiled it to WebAssembly so anyone can play with it in their browser. No installation needed - just paste your structs and see where all those bytes are going!

Tech stack

  • Go;
  • WebAssembly;
  • Vercel;