optimize encoder: fused text writes, stack sort for small maps
Fuse header+payload into a single writeAll for text strings < 24 bytes
(all AT Protocol map keys), halving writer dispatch count per key. Use a
stack buffer for sorting maps with ≤16 entries (all AT Protocol records),
eliminating allocator calls on the sort path. Encode+CID path improves
~9%, full record encode ~7%.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>