Skip to content

function! BeancountFoldexpr() causing significant lag #69

Description

@alexason

Hi there,

Just went through the process of installing vim-beancount on a new computer and found significant lag after installing the plugin. Seems to occur with most operations, i.e. with account auto completion and in auto aligning of the commodity.

I ran a :h profile in vim and just tried typing a commodity value, letting it auto complete then deleting. See the times below, 6.421180s for BeancountFoldexpr().

I subsequently rolled back to a version circa march last year and issue was gone. Given the last commit was implementation of the beancount#align_commodity() function I am pretty sure this is the culprit.

I have attached the profile.log file if this helps. In addition my vimrc has folding set to indent.

Please let me know if I can assist further.

Cheers,
Alexason

profile.log

FUNCTIONS SORTED ON SELF TIME
count total (s) self (s) function
699132 6.421180 BeancountFoldexpr()
1 0.136508 0.012212 beancount#align_commodity()
58 0.002640 0.002322 18_Highlight_Matching_Pair()
58 0.000318 18_Remove_Matches()
1 0.000042 0.000024 GetBeancountIndent()
1 0.000007 28_IsDirective()
1 0.000005 28_IsTransaction()
1 0.000003 28_IsPosting()
1 0.000003 28_IsMetadata()

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