[vim/vim] Running test_vim9_builtin.vim tests is slow (PR #14614)

9 views
Skip to first unread message

Yegappan Lakshmanan

unread,
Apr 21, 2024, 9:09:26 PMApr 21
to vim/vim, Subscribed

The tests in test_vim9_builtin.vim use the CheckDefAndScriptFailure(), CheckDefExecFailure(), etc. functions from the vim9.vim file.
These functions store the supplied lines in a file and then source the file. This takes time. Instead of using a file, these lines can be stored in a buffer and then sourced. This method is already used by the new Vim9 test scripts (e.g. test_vim9_class.vim, test_vim9_typealias.vim, test_vim9_enum.vim etc.). Convert the tests in test_vim9_builtin.vim to use the new functions.

Before this change, it used to take around 22 seconds to run the tests. After this change, it takes around 2.5 seconds.


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

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

Commit Summary

  • ccfc0df Running test_vim9_builtin.vim tests is slow

File Changes

(3 files)

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/14614@github.com>

Yegappan Lakshmanan

unread,
Apr 22, 2024, 11:24:30 AMApr 22
to vim...@googlegroups.com, reply+ACY5DGCUHH4DHQVFJG...@reply.github.com, vim/vim, Subscribed
On Sun, Apr 21, 2024 at 6:09 PM Yegappan Lakshmanan <vim-dev...@256bit.org> wrote:

The tests in test_vim9_builtin.vim use the CheckDefAndScriptFailure(), CheckDefExecFailure(), etc. functions from the vim9.vim file.
These functions store the supplied lines in a file and then source the file. This takes time. Instead of using a file, these lines can be stored in a buffer and then sourced. This method is already used by the new Vim9 test scripts (e.g. test_vim9_class.vim, test_vim9_typealias.vim, test_vim9_enum.vim etc.). Convert the tests in test_vim9_builtin.vim to use the new functions.

Before this change, it used to take around 22 seconds to run the tests. After this change, it takes around 2.5 seconds.



I was running the test with the address sanitizer enabled which resulted in 22 seconds.  Without ASAN, it takes around
8 seconds to run the tests in test_vim9_builtin.vim.

vim-dev ML

unread,
Apr 22, 2024, 11:24:54 AMApr 22
to vim/vim, vim-dev ML, Your activity

On Sun, Apr 21, 2024 at 6:09 PM Yegappan Lakshmanan <
***@***.***> wrote:

> The tests in test_vim9_builtin.vim use the CheckDefAndScriptFailure(),
> CheckDefExecFailure(), etc. functions from the vim9.vim file.
> These functions store the supplied lines in a file and then source the
> file. This takes time. Instead of using a file, these lines can be stored
> in a buffer and then sourced. This method is already used by the new Vim9
> test scripts (e.g. test_vim9_class.vim, test_vim9_typealias.vim,
> test_vim9_enum.vim etc.). Convert the tests in test_vim9_builtin.vim to use
> the new functions.
>
> Before this change, it used to take around 22 seconds to run the tests.
> After this change, it takes around 2.5 seconds.
>
>
I was running the test with the address sanitizer enabled which resulted in
22 seconds. Without ASAN, it takes around
8 seconds to run the tests in test_vim9_builtin.vim.


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/14614/c2069876063@github.com>

Christian Brabandt

unread,
Apr 22, 2024, 2:58:11 PMApr 22
to vim/vim, vim-dev ML, Comment

thanks!


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/pull/14614/c2070658698@github.com>

Christian Brabandt

unread,
Apr 22, 2024, 3:03:30 PMApr 22
to vim/vim, vim-dev ML, Comment

Closed #14614 via 22697b6.


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/pull/14614/issue_event/12564482897@github.com>

Reply all
Reply to author
Forward
0 new messages