Skip to content

Implement view cache #8

Description

@eatablekolas

The current implementation of Session:replace_sources (which, as I understand, is ran every time you switch between files in :DiffBanditGit, among other things) always calls this function:

local hunks, view = build_view_for_sources(sources, self.config)

This means that, on every switch between files, even when there's been no change to the source files, the method forces:

I suspect this might be causing a significant drop in performance (on my machine it literally stalls for a few seconds). A simple cache for the built views might be enough to save on computing power without sacrificing too much memory. That way views would only have to be re-built when there's been a change to the viewed file, or when re-entering the DiffBandit screen.

PS I really like this plugin, especially the visuals! The performance is really my only issue with it, and if that could be fixed, this would be the perfect plugin for viewing diffs and merge conflicts :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions