Brad Fitzpatrick c7d68724ad types/key: shrink NodePublic by using unique.Handle representation
@raggi and I have been experimenting with using unique.Handle for
public keys in various places.

This is an experiment to see what it looks like just going all the
way, so a NodePublic is always just a single word (a single pointer)
behind the scenes, so 8 bytes (in practice, on 64-bit) instead of 32
bytes.

Downsides are some extra unique.Make lookups (probably cheap enough)
and it makes data structures that were previously skipped by GC as
having no pointers no longer skipped. But on the upside, it saves
memory and makes certain operations much faster.

Updates tailscale/corp#24485

Change-Id: Ic5c807b86b465769b046fba5d640c4fe73bf2a2f
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-11-11 12:40:28 -08:00
..