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