[vim/vim] Optimize repeat() string copying (PR #19977)

3 views
Skip to first unread message

mattn

unread,
Apr 14, 2026, 12:30:43 PMApr 14
to vim/vim, Subscribed

This changes string handling in repeat() to copy the initial chunk once and then grow the result by copying from the already-built output buffer. That reduces the number of memmove() calls for larger repeat counts while preserving behavior.

Case Before After Change
repeat('ab', 64) 0.1939 s 0.1866 s 1.04x faster

You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/19977

Commit Summary

  • bc31dcf Optimize repeat() string copying

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19977@github.com>

Christian Brabandt

unread,
Apr 15, 2026, 12:21:27 PMApr 15
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19977)

thanks


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19977/c4253690895@github.com>

Christian Brabandt

unread,
Apr 15, 2026, 12:40:09 PMApr 15
to vim/vim, Subscribed

Closed #19977 via bfa46a5.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19977/issue_event/24536696584@github.com>

Reply all
Reply to author
Forward
0 new messages