view src/testdir/bench_re_freeze.vim @ 17516:711db62c8aca v8.1.1756

patch 8.1.1756: autocommand that splits window messes up window layout commit https://github.com/vim/vim/commit/1417c766f55e5959b31da488417b7d9b141404af Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 27 17:31:36 2019 +0200 patch 8.1.1756: autocommand that splits window messes up window layout Problem: Autocommand that splits window messes up window layout. Solution: Disallow splitting a window while closing one. In ":all" give an error when moving a window will not work.
author Bram Moolenaar <Bram@vim.org>
date Sat, 27 Jul 2019 17:45:06 +0200
parents adfbffe1e642
children
line wrap: on
line source

"Test for benchmarking the RE engine

so small.vim
if !has("reltime") | finish | endif
func! Measure(file, pattern, arg)
	for re in range(3)
	    let sstart=reltime()
	    let cmd=printf("../vim -u NONE -N --cmd ':set re=%d'".
		\ " -c 'call search(\"%s\", \"\", \"\", 10000)' -c ':q!' %s", re, escape(a:pattern, '\\'), empty(a:arg) ? '' : a:arg)
	    call system(cmd. ' '. a:file)
	    $put =printf('file: %s, re: %d, time: %s', a:file, re, reltimestr(reltime(sstart)))
	endfor
endfunc