Skip to content

Navigation Menu

Sign in
Sign up

perf(reactionpicker): fold candidate names once - #177

Open
YousefHadder wants to merge 1 commit into
gammons:main from
YousefHadder:yousefhadder/fold-performance-followups
Open

perf(reactionpicker): fold candidate names once #177
YousefHadder wants to merge 1 commit into
gammons:main from
YousefHadder:yousefhadder/fold-performance-followups

Conversation

@YousefHadder

@YousefHadder YousefHadder commented Sep 4, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Summary

  • fold each reaction-picker candidate name once and reuse it for prefix and substring checks
  • cover substring selection through the exported SetCustomEmoji, Open, and HandleKey seam, observing the selected ReactionResult
  • benchmark a full-scan query over 10,000 custom emoji through the same input seam

This is the first of two independent performance follow-ups requested after PR #174 / issue #165.

Benchmark

Apple M3 Max, darwin/arm64:

go test ./internal/ui/reactionpicker -run '^$' -bench '^BenchmarkFilterByQuery$' -benchmem -count=6 -benchtime=500ms

Observed median: 604,271 -> 341,907 ns/op (43.4% lower). Memory remained 0 B/op, 0 allocs/op before and after.

Testing

  • go test ./internal/ui/reactionpicker -run 'TestSubstringSearchSelectsCustomEmoji|TestFilterByQuery'
  • go test -race ./internal/ui/reactionpicker
  • benchmark command above

Refs #165

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /