picoclaw/pkg/devices
dj-oyu 7912b22d8f perf: eliminate intermediate string allocations in hot paths
- Replace WriteString(fmt.Sprintf(...)) with fmt.Fprintf() across 7 files
  to avoid intermediate string allocation (writes directly to Builder)
- Refactor telegram message composition from O(n²) += to strings.Builder
- Refactor device event formatting from += chain to strings.Builder
- Fix lint issues: misspell, whitespace, gofumpt, gci, unused func

## Benchmark Results

WriteString(Sprintf) vs Fprintf (10-iteration loop, 5 fields each):
  old: 2480 ns/op   2823 B/op   16 allocs/op
  new: 1841 ns/op   1860 B/op    6 allocs/op
  → 26% faster, 34% less memory, 63% fewer allocations

Telegram message build (+= vs strings.Builder):
  AllMedia:  old 403 ns/1104 B/10 allocs → new 118 ns/336 B/3 allocs (3.4x faster)
  LongText:  old 8309 ns/47232 B/10 allocs → new 1483 ns/8064 B/2 allocs (5.6x faster)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 11:56:07 +09:00
..
events perf: eliminate intermediate string allocations in hot paths 2026-03-19 11:56:07 +09:00
sources Merge upstream/main: cobra CLI, channel refactoring, media store, reasoning support 2026-02-28 21:18:40 +09:00
service.go Merge upstream/main: cobra CLI, channel refactoring, media store, reasoning support 2026-02-28 21:18:40 +09:00
source.go feat: add device hotplug event notifications (USB on Linux) 2026-02-14 17:03:04 +08:00