Dave Cheney 5/9/2020

Ensmallening Go binaries by prohibiting comparisons

Read Original

This technical article explains how Go's equality and comparison semantics impact binary size. It details how struct padding and compiler-generated equality functions increase binary size, and demonstrates how using the `comparable` type constraint or `func(){}` field to prohibit comparisons can lead to smaller executables.

Ensmallening Go binaries by prohibiting comparisons

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week