zeekayandHanzo Dev 8c27b47bdf wire: pool builders + SetBytesFixed for IDs — 1.9x faster X-tx composition
Write-path hot fix across all 21 wire constructors:
- zap.NewBuilder(capEstimate) -> zap.GetBuilder()/defer PutBuilder: recycle the
  Builder + its grown backing array (needs zap v1.2.2). All 21 return
  writeEnvelopePrefix(...b.Finish()), which COPIES out before the deferred Put,
  so pooling is safe.
- 7 per-byte ID loops (for i<32 { SetUint8(off+i, id[i]) }) -> one SetBytesFixed
  memcpy (TxID/AssetID/BlockchainID in utxo, transferable, xvm_base_tx;
  AttestedHash in attestation).
- rides zap v1.2.2's zero-copy SetBytes (no per-field heap copy).

Composite X-chain money-move (2out+2in, secp256k1fx) wire build:
2551ns/5328B/37allocs -> 1345ns/2401B/19allocs (1.9x faster, 2.2x less mem,
48% fewer allocs). Byte output UNCHANGED — full round-trip suite (11 pkgs) green.

Co-authored-by: Hanzo Dev <dev@hanzo.ai>
2026-07-13 03:43:05 -07:00
2026-01-10 02:00:48 -08:00
2026-01-10 02:00:48 -08:00
2026-02-14 05:26:25 -08:00
2026-01-10 02:00:48 -08:00
2026-01-10 02:00:48 -08:00
2026-01-10 02:00:48 -08:00
2026-01-10 02:00:48 -08:00
2026-01-10 02:00:48 -08:00
S
Description
No description provided
BSD-3-Clause
12 MiB
Languages
Go 100%