view src/testdir/bench_re_freeze.vim @ 15506:8b508af36a80 v8.1.0761

patch 8.1.0761: default value for brief_wait is wrong commit https://github.com/vim/vim/commit/e299bbdf6e7edd633501b7a0e11c349c703c361b Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 17 14:12:02 2019 +0100 patch 8.1.0761: default value for brief_wait is wrong Problem: Default value for brief_wait is wrong. Solution: Make the default FALSE. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/3812, closes https://github.com/vim/vim/issues/3799)
author Bram Moolenaar <Bram@vim.org>
date Thu, 17 Jan 2019 14:15:05 +0100
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