Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rendering performance issue when using :version or echo commands #840

Merged
merged 1 commit into from
Feb 3, 2019

Commits on Feb 3, 2019

  1. Fix rendering performance issue when using :version or echo commands

    This fixes 10.14 Mojave's CoreText renderer taking a long time to render
    :version / :ls / :! / :echo or similar commands.
    
    This issue happened because the way Vim echos the output of those
    commands is by issuing a draw calls in the pattern of "delete 1 line,
    draw some text, delete another line...". Each line delete causes the
    renderer to do a scroll. The pre-Mojave renderer relies on calling
    scrollRect: but this doesn't work in Mojave anymore since that function
    is deprecated and doesn't work in layer-backed views (which are now
    mandatory). The new renderer's scroll implementation is a lot slower
    since it's doing image blits on CPU.
    
    The fix is to implement a draw command optimizer that pre-processes the
    draw calls first. It works by batching together all the "delete 1 line"
    calls and combine into a single "delete N lines" call and put that in
    the beginning, and fixing up all the other draw string command so they
    draw to the right line instead of needing to be scrolled up. This makes
    :version or the other calls feel instaneous now.
    
    This fix is ultimately a hack and an intermediary solution before the
    renderer can be replaced (since the slow CPU scrolling causes normal
    usage to feel sluggish as well) by a GPU-based renderer and/or a
    glyph-based one that caches the state of the texts so repeated scrolling
    can be done by shuffling the glpyh data around instead of an actualy image
    blit.
    
    Fix macvim-dev#815
    ychin committed Feb 3, 2019
    Configuration menu
    Copy the full SHA
    b4014c8 View commit details
    Browse the repository at this point in the history