@@ -241,8 +241,19 @@ func (a *anim) updateChars(chars *[]cyclingChar) {
242// View renders the animation.
242// View renders the animation.
243func (a anim) View() tea.View {
243func (a anim) View() tea.View {
244− t := styles.CurrentTheme()
245+ t = styles.CurrentTheme()
245− var b strings.Builder
246+ b strings.Builder
249+ // Pre-allocate builder capacity to avoid reallocations.
250+ // Estimate: cycling chars + label chars + ellipsis + style overhead.
252+ bytesPerChar = 20 // ANSI styling
253+ bufferSize = 50 // ellipsis and safety margin
255+ estimatedCap := len(a.cyclingChars)*bytesPerChar + len(a.labelChars)*bytesPerChar + bufferSize
256+ b.Grow(estimatedCap)
247 for i, c := range a.cyclingChars {
258 for i, c := range a.cyclingChars {
248 if len(a.ramp) > i {
259 if len(a.ramp) > i {