Deprecate Gob serializer or add performance warning #61

Closed
opened 2026-02-21 22:43:22 +00:00 by ash · 0 comments
Owner

Problem

Benchmarks show Gob is catastrophically slow:

  • Small deserialize: 16,259 ns/op (vs JSON jsoniter 429 ns/op) — 38x slower
  • Large deserialize: 39,982 ns/op (vs JSON jsoniter 6,008 ns/op) — 6.6x slower
  • Small serialize: 2,657 ns/op (vs JSON 349 ns/op) — 7.6x slower

Gob also produces larger payloads (117B vs 87B for small events).

Options

  1. Deprecate — remove from docs, add deprecation notice
  2. Warn — keep but add doc comment: "Gob is 6-38x slower than JSON. Use only for Go-to-Go internal systems."
  3. Remove — breaking change, but saves maintenance

Recommendation

Option 2 for now. Default serializer should be jsoniter JSON.

Acceptance

  • Default serializer changed to jsoniter (or clearly documented)
  • Gob serializer has prominent performance warning
  • Benchmark comparison in docs
## Problem Benchmarks show Gob is catastrophically slow: - Small deserialize: 16,259 ns/op (vs JSON jsoniter 429 ns/op) — **38x slower** - Large deserialize: 39,982 ns/op (vs JSON jsoniter 6,008 ns/op) — **6.6x slower** - Small serialize: 2,657 ns/op (vs JSON 349 ns/op) — **7.6x slower** Gob also produces larger payloads (117B vs 87B for small events). ## Options 1. **Deprecate** — remove from docs, add deprecation notice 2. **Warn** — keep but add doc comment: "Gob is 6-38x slower than JSON. Use only for Go-to-Go internal systems." 3. **Remove** — breaking change, but saves maintenance ## Recommendation Option 2 for now. Default serializer should be jsoniter JSON. ## Acceptance - [ ] Default serializer changed to jsoniter (or clearly documented) - [ ] Gob serializer has prominent performance warning - [ ] Benchmark comparison in docs
ash 2026-02-21 22:43:22 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ash/eskit#61
No description provided.