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

function! BeancountFoldexpr() causing significant lag #69

Open
alexason opened this issue Apr 27, 2021 · 3 comments
Open

function! BeancountFoldexpr() causing significant lag #69

alexason opened this issue Apr 27, 2021 · 3 comments

Comments

@alexason
Copy link

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()

@mschwld
Copy link

mschwld commented Apr 28, 2021

Same issue here. After switching back to this commit the issue was gone for me.

@xentac
Copy link
Collaborator

xentac commented Apr 29, 2021

Sorry everyone. I was trying to speed up folding in my own file. Syntax folding was particularly slow for me. How big are your beancount files, how many folds do you think you have, and do you open the files with everything folded like I do?

@mschwld
Copy link

mschwld commented May 8, 2021

My beancount file currently has 828KB with around 19K lines in total. But i disabled folding using the following in $HOME/.vimrc (taken from #61):

augroup filetype_options
  autocmd Filetype beancount setlocal nofoldenable
augroup END

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants